From a9c319c4931f03eb1f0605300c15b96e658ad496 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Mon, 23 Dec 2024 10:01:54 +0000 Subject: [PATCH] Generate iaas --- services/iaas/src/stackit/iaas/__init__.py | 30 +- .../iaas/src/stackit/iaas/api/default_api.py | 16767 ++++++++++++---- .../iaas/src/stackit/iaas/models/__init__.py | 30 +- .../src/stackit/iaas/models/affinity_group.py | 120 + .../models/affinity_group_list_response.py | 97 + ....py => availability_zone_list_response.py} | 20 +- .../iaas/src/stackit/iaas/models/backup.py | 198 + .../iaas/models/backup_list_response.py | 93 + .../src/stackit/iaas/models/backup_source.py | 95 + .../models/create_affinity_group_payload.py | 120 + .../iaas/models/create_backup_payload.py | 110 + .../iaas/models/create_image_payload.py | 206 + .../iaas/models/create_snapshot_payload.py | 158 + .../iaas/models/create_volume_payload.py | 11 + .../iaas/src/stackit/iaas/models/image.py | 206 + .../src/stackit/iaas/models/image_checksum.py | 91 + .../src/stackit/iaas/models/image_config.py | 180 + .../iaas/models/image_create_response.py | 95 + .../iaas/models/image_list_response.py | 93 + .../src/stackit/iaas/models/image_share.py | 91 + .../iaas/models/image_share_consumer.py | 137 + .../iaas/src/stackit/iaas/models/quota.py | 83 + .../src/stackit/iaas/models/quota_list.py | 165 + .../iaas/models/quota_list_response.py | 89 + .../iaas/models/set_image_share_payload.py | 91 + .../iaas/src/stackit/iaas/models/snapshot.py | 158 + .../iaas/models/snapshot_list_response.py | 93 + .../iaas/models/update_backup_payload.py | 198 + .../iaas/models/update_image_payload.py | 128 + .../iaas/models/update_image_share_payload.py | 91 + .../iaas/models/update_snapshot_payload.py | 98 + .../iaas/models/update_volume_payload.py | 11 +- .../iaas/src/stackit/iaas/models/volume.py | 11 + 33 files changed, 16206 insertions(+), 3958 deletions(-) create mode 100644 services/iaas/src/stackit/iaas/models/affinity_group.py create mode 100644 services/iaas/src/stackit/iaas/models/affinity_group_list_response.py rename services/iaas/src/stackit/iaas/models/{get_server_log_request.py => availability_zone_list_response.py} (76%) create mode 100644 services/iaas/src/stackit/iaas/models/backup.py create mode 100644 services/iaas/src/stackit/iaas/models/backup_list_response.py create mode 100644 services/iaas/src/stackit/iaas/models/backup_source.py create mode 100644 services/iaas/src/stackit/iaas/models/create_affinity_group_payload.py create mode 100644 services/iaas/src/stackit/iaas/models/create_backup_payload.py create mode 100644 services/iaas/src/stackit/iaas/models/create_image_payload.py create mode 100644 services/iaas/src/stackit/iaas/models/create_snapshot_payload.py create mode 100644 services/iaas/src/stackit/iaas/models/image.py create mode 100644 services/iaas/src/stackit/iaas/models/image_checksum.py create mode 100644 services/iaas/src/stackit/iaas/models/image_config.py create mode 100644 services/iaas/src/stackit/iaas/models/image_create_response.py create mode 100644 services/iaas/src/stackit/iaas/models/image_list_response.py create mode 100644 services/iaas/src/stackit/iaas/models/image_share.py create mode 100644 services/iaas/src/stackit/iaas/models/image_share_consumer.py create mode 100644 services/iaas/src/stackit/iaas/models/quota.py create mode 100644 services/iaas/src/stackit/iaas/models/quota_list.py create mode 100644 services/iaas/src/stackit/iaas/models/quota_list_response.py create mode 100644 services/iaas/src/stackit/iaas/models/set_image_share_payload.py create mode 100644 services/iaas/src/stackit/iaas/models/snapshot.py create mode 100644 services/iaas/src/stackit/iaas/models/snapshot_list_response.py create mode 100644 services/iaas/src/stackit/iaas/models/update_backup_payload.py create mode 100644 services/iaas/src/stackit/iaas/models/update_image_payload.py create mode 100644 services/iaas/src/stackit/iaas/models/update_image_share_payload.py create mode 100644 services/iaas/src/stackit/iaas/models/update_snapshot_payload.py diff --git a/services/iaas/src/stackit/iaas/__init__.py b/services/iaas/src/stackit/iaas/__init__.py index 638947b9..0dc4b778 100644 --- a/services/iaas/src/stackit/iaas/__init__.py +++ b/services/iaas/src/stackit/iaas/__init__.py @@ -35,15 +35,26 @@ # import models into sdk package from stackit.iaas.models.add_volume_to_server_payload import AddVolumeToServerPayload +from stackit.iaas.models.affinity_group import AffinityGroup +from stackit.iaas.models.affinity_group_list_response import AffinityGroupListResponse from stackit.iaas.models.allowed_addresses_inner import AllowedAddressesInner from stackit.iaas.models.area import Area from stackit.iaas.models.area_config import AreaConfig from stackit.iaas.models.area_prefix_config_ipv4 import AreaPrefixConfigIPv4 +from stackit.iaas.models.availability_zone_list_response import ( + AvailabilityZoneListResponse, +) +from stackit.iaas.models.backup import Backup +from stackit.iaas.models.backup_list_response import BackupListResponse +from stackit.iaas.models.backup_source import BackupSource from stackit.iaas.models.base_security_group_rule import BaseSecurityGroupRule from stackit.iaas.models.boot_volume import BootVolume from stackit.iaas.models.boot_volume_source import BootVolumeSource +from stackit.iaas.models.create_affinity_group_payload import CreateAffinityGroupPayload from stackit.iaas.models.create_area_address_family import CreateAreaAddressFamily from stackit.iaas.models.create_area_ipv4 import CreateAreaIPv4 +from stackit.iaas.models.create_backup_payload import CreateBackupPayload +from stackit.iaas.models.create_image_payload import CreateImagePayload from stackit.iaas.models.create_key_pair_payload import CreateKeyPairPayload from stackit.iaas.models.create_network_address_family import CreateNetworkAddressFamily from stackit.iaas.models.create_network_area_payload import CreateNetworkAreaPayload @@ -74,11 +85,18 @@ from stackit.iaas.models.create_server_payload_networking import ( CreateServerPayloadNetworking, ) +from stackit.iaas.models.create_snapshot_payload import CreateSnapshotPayload from stackit.iaas.models.create_volume_payload import CreateVolumePayload from stackit.iaas.models.error import Error from stackit.iaas.models.get_server_log200_response import GetServerLog200Response -from stackit.iaas.models.get_server_log_request import GetServerLogRequest from stackit.iaas.models.icmp_parameters import ICMPParameters +from stackit.iaas.models.image import Image +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_list_response import ImageListResponse +from stackit.iaas.models.image_share import ImageShare +from stackit.iaas.models.image_share_consumer import ImageShareConsumer from stackit.iaas.models.key_pair_list_response import KeyPairListResponse from stackit.iaas.models.keypair import Keypair from stackit.iaas.models.machine_type import MachineType @@ -103,6 +121,9 @@ from stackit.iaas.models.protocol import Protocol from stackit.iaas.models.public_ip import PublicIp from stackit.iaas.models.public_ip_list_response import PublicIpListResponse +from stackit.iaas.models.quota import Quota +from stackit.iaas.models.quota_list import QuotaList +from stackit.iaas.models.quota_list_response import QuotaListResponse from stackit.iaas.models.request import Request from stackit.iaas.models.request_resource import RequestResource from stackit.iaas.models.rescue_server_payload import RescueServerPayload @@ -125,11 +146,17 @@ from stackit.iaas.models.service_account_mail_list_response import ( ServiceAccountMailListResponse, ) +from stackit.iaas.models.set_image_share_payload import SetImageSharePayload +from stackit.iaas.models.snapshot import Snapshot +from stackit.iaas.models.snapshot_list_response import SnapshotListResponse from stackit.iaas.models.update_area_address_family import UpdateAreaAddressFamily from stackit.iaas.models.update_area_ipv4 import UpdateAreaIPv4 from stackit.iaas.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaas.models.update_backup_payload import UpdateBackupPayload +from stackit.iaas.models.update_image_payload import UpdateImagePayload +from stackit.iaas.models.update_image_share_payload import UpdateImageSharePayload from stackit.iaas.models.update_key_pair_payload import UpdateKeyPairPayload from stackit.iaas.models.update_network_address_family import UpdateNetworkAddressFamily from stackit.iaas.models.update_network_area_route_payload import ( @@ -141,6 +168,7 @@ from stackit.iaas.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaas.models.update_security_group_payload import UpdateSecurityGroupPayload from stackit.iaas.models.update_server_payload import UpdateServerPayload +from stackit.iaas.models.update_snapshot_payload import UpdateSnapshotPayload from stackit.iaas.models.update_volume_payload import UpdateVolumePayload from stackit.iaas.models.volume import Volume from stackit.iaas.models.volume_attachment import VolumeAttachment diff --git a/services/iaas/src/stackit/iaas/api/default_api.py b/services/iaas/src/stackit/iaas/api/default_api.py index 9aa38e94..2a26c2a0 100644 --- a/services/iaas/src/stackit/iaas/api/default_api.py +++ b/services/iaas/src/stackit/iaas/api/default_api.py @@ -28,6 +28,16 @@ from stackit.iaas.api_client import ApiClient, RequestSerialized from stackit.iaas.api_response import ApiResponse from stackit.iaas.models.add_volume_to_server_payload import AddVolumeToServerPayload +from stackit.iaas.models.affinity_group import AffinityGroup +from stackit.iaas.models.affinity_group_list_response import AffinityGroupListResponse +from stackit.iaas.models.availability_zone_list_response import ( + AvailabilityZoneListResponse, +) +from stackit.iaas.models.backup import Backup +from stackit.iaas.models.backup_list_response import BackupListResponse +from stackit.iaas.models.create_affinity_group_payload import CreateAffinityGroupPayload +from stackit.iaas.models.create_backup_payload import CreateBackupPayload +from stackit.iaas.models.create_image_payload import CreateImagePayload from stackit.iaas.models.create_key_pair_payload import CreateKeyPairPayload from stackit.iaas.models.create_network_area_payload import CreateNetworkAreaPayload from stackit.iaas.models.create_network_area_range_payload import ( @@ -44,9 +54,14 @@ CreateSecurityGroupRulePayload, ) from stackit.iaas.models.create_server_payload import CreateServerPayload +from stackit.iaas.models.create_snapshot_payload import CreateSnapshotPayload from stackit.iaas.models.create_volume_payload import CreateVolumePayload from stackit.iaas.models.get_server_log200_response import GetServerLog200Response -from stackit.iaas.models.get_server_log_request import GetServerLogRequest +from stackit.iaas.models.image import Image +from stackit.iaas.models.image_create_response import ImageCreateResponse +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 from stackit.iaas.models.key_pair_list_response import KeyPairListResponse from stackit.iaas.models.keypair import Keypair from stackit.iaas.models.machine_type import MachineType @@ -68,6 +83,7 @@ from stackit.iaas.models.project_list_response import ProjectListResponse from stackit.iaas.models.public_ip import PublicIp from stackit.iaas.models.public_ip_list_response import PublicIpListResponse +from stackit.iaas.models.quota_list_response import QuotaListResponse from stackit.iaas.models.request import Request from stackit.iaas.models.rescue_server_payload import RescueServerPayload from stackit.iaas.models.resize_server_payload import ResizeServerPayload @@ -86,9 +102,15 @@ from stackit.iaas.models.service_account_mail_list_response import ( ServiceAccountMailListResponse, ) +from stackit.iaas.models.set_image_share_payload import SetImageSharePayload +from stackit.iaas.models.snapshot import Snapshot +from stackit.iaas.models.snapshot_list_response import SnapshotListResponse from stackit.iaas.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaas.models.update_backup_payload import UpdateBackupPayload +from stackit.iaas.models.update_image_payload import UpdateImagePayload +from stackit.iaas.models.update_image_share_payload import UpdateImageSharePayload from stackit.iaas.models.update_key_pair_payload import UpdateKeyPairPayload from stackit.iaas.models.update_network_area_route_payload import ( UpdateNetworkAreaRoutePayload, @@ -97,6 +119,7 @@ from stackit.iaas.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaas.models.update_security_group_payload import UpdateSecurityGroupPayload from stackit.iaas.models.update_server_payload import UpdateServerPayload +from stackit.iaas.models.update_snapshot_payload import UpdateSnapshotPayload from stackit.iaas.models.update_volume_payload import UpdateVolumePayload from stackit.iaas.models.volume import Volume from stackit.iaas.models.volume_attachment import VolumeAttachment @@ -1966,9 +1989,15 @@ def _add_volume_to_server_serialize( ) @validate_call - def create_key_pair( + def create_affinity_group( self, - create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + create_affinity_group_payload: Annotated[ + CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1978,13 +2007,15 @@ def create_key_pair( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Keypair: - """Import a public key. + ) -> AffinityGroup: + """Create a new affinity group in a project. - Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + Create a new server affinity group in the given project ID. - :param create_key_pair_payload: Request a public key import. (required) - :type create_key_pair_payload: CreateKeyPairPayload + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_affinity_group_payload: Request a affinity group creation. (required) + :type create_affinity_group_payload: CreateAffinityGroupPayload :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 @@ -2007,8 +2038,9 @@ def create_key_pair( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_key_pair_serialize( - create_key_pair_payload=create_key_pair_payload, + _param = self._create_affinity_group_serialize( + project_id=project_id, + create_affinity_group_payload=create_affinity_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2016,12 +2048,11 @@ def create_key_pair( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", + "201": "AffinityGroup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2032,9 +2063,15 @@ def create_key_pair( ).data @validate_call - def create_key_pair_with_http_info( + def create_affinity_group_with_http_info( self, - create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + create_affinity_group_payload: Annotated[ + CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2044,13 +2081,15 @@ def create_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]: - """Import a public key. + ) -> ApiResponse[AffinityGroup]: + """Create a new affinity group in a project. - Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + Create a new server affinity group in the given project ID. - :param create_key_pair_payload: Request a public key import. (required) - :type create_key_pair_payload: CreateKeyPairPayload + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_affinity_group_payload: Request a affinity group creation. (required) + :type create_affinity_group_payload: CreateAffinityGroupPayload :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 @@ -2073,8 +2112,9 @@ def create_key_pair_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_key_pair_serialize( - create_key_pair_payload=create_key_pair_payload, + _param = self._create_affinity_group_serialize( + project_id=project_id, + create_affinity_group_payload=create_affinity_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2082,12 +2122,11 @@ def create_key_pair_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", + "201": "AffinityGroup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2098,9 +2137,15 @@ def create_key_pair_with_http_info( ) @validate_call - def create_key_pair_without_preload_content( + def create_affinity_group_without_preload_content( self, - create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + create_affinity_group_payload: Annotated[ + CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2111,12 +2156,14 @@ def create_key_pair_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Import a public key. + """Create a new affinity group in a project. - Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + Create a new server affinity group in the given project ID. - :param create_key_pair_payload: Request a public key import. (required) - :type create_key_pair_payload: CreateKeyPairPayload + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_affinity_group_payload: Request a affinity group creation. (required) + :type create_affinity_group_payload: CreateAffinityGroupPayload :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 @@ -2139,8 +2186,9 @@ def create_key_pair_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_key_pair_serialize( - create_key_pair_payload=create_key_pair_payload, + _param = self._create_affinity_group_serialize( + project_id=project_id, + create_affinity_group_payload=create_affinity_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2148,20 +2196,20 @@ def create_key_pair_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", + "201": "AffinityGroup", "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 _create_key_pair_serialize( + def _create_affinity_group_serialize( self, - create_key_pair_payload, + project_id, + create_affinity_group_payload, _request_auth, _content_type, _headers, @@ -2180,12 +2228,14 @@ def _create_key_pair_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 # process the header parameters # process the form parameters # process the body parameter - if create_key_pair_payload is not None: - _body_params = create_key_pair_payload + if create_affinity_group_payload is not None: + _body_params = create_affinity_group_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -2204,7 +2254,7 @@ def _create_key_pair_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/keypairs", + resource_path="/v1beta1/projects/{projectId}/affinity-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2218,13 +2268,13 @@ def _create_key_pair_serialize( ) @validate_call - def create_network( + def create_backup( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], + create_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2234,15 +2284,15 @@ def create_network( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Network: - """Create new network. + ) -> Backup: + """Create new Backup. - Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_network_payload: Request a network creation. (required) - :type create_network_payload: CreateNetworkPayload + :param create_backup_payload: Request a backup creation. (required) + :type create_backup_payload: CreateBackupPayload :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 @@ -2265,9 +2315,9 @@ def create_network( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_serialize( + _param = self._create_backup_serialize( project_id=project_id, - create_network_payload=create_network_payload, + create_backup_payload=create_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2275,12 +2325,11 @@ def create_network( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Network", + "201": "Backup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2291,13 +2340,13 @@ def create_network( ).data @validate_call - def create_network_with_http_info( + def create_backup_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_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], + create_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2307,15 +2356,15 @@ def create_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]: - """Create new network. + ) -> ApiResponse[Backup]: + """Create new Backup. - Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_network_payload: Request a network creation. (required) - :type create_network_payload: CreateNetworkPayload + :param create_backup_payload: Request a backup creation. (required) + :type create_backup_payload: CreateBackupPayload :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 @@ -2338,9 +2387,9 @@ def create_network_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_serialize( + _param = self._create_backup_serialize( project_id=project_id, - create_network_payload=create_network_payload, + create_backup_payload=create_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2348,12 +2397,11 @@ def create_network_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Network", + "201": "Backup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2364,13 +2412,13 @@ def create_network_with_http_info( ) @validate_call - def create_network_without_preload_content( + def create_backup_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_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], + create_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2381,14 +2429,14 @@ def create_network_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new network. + """Create new Backup. - Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_network_payload: Request a network creation. (required) - :type create_network_payload: CreateNetworkPayload + :param create_backup_payload: Request a backup creation. (required) + :type create_backup_payload: CreateBackupPayload :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 @@ -2411,9 +2459,9 @@ def create_network_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_serialize( + _param = self._create_backup_serialize( project_id=project_id, - create_network_payload=create_network_payload, + create_backup_payload=create_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2421,21 +2469,20 @@ def create_network_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Network", + "201": "Backup", "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 _create_network_serialize( + def _create_backup_serialize( self, project_id, - create_network_payload, + create_backup_payload, _request_auth, _content_type, _headers, @@ -2460,8 +2507,8 @@ def _create_network_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_network_payload is not None: - _body_params = create_network_payload + if create_backup_payload is not None: + _body_params = create_backup_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -2480,7 +2527,7 @@ def _create_network_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/networks", + resource_path="/v1beta1/projects/{projectId}/backups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2494,17 +2541,13 @@ def _create_network_serialize( ) @validate_call - def create_network_area( + def create_image( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - create_network_area_payload: Annotated[ - CreateNetworkAreaPayload, Field(description="Request an Area creation.") + 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)], @@ -2514,15 +2557,15 @@ def create_network_area( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkArea: - """Create new network area in an organization. + ) -> ImageCreateResponse: + """Create new Image. - Create a new network area in an organization. + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param create_network_area_payload: Request an Area creation. (required) - :type create_network_area_payload: CreateNetworkAreaPayload + :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 @@ -2545,9 +2588,9 @@ def create_network_area( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_serialize( - organization_id=organization_id, - create_network_area_payload=create_network_area_payload, + _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, @@ -2555,11 +2598,12 @@ def create_network_area( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "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) @@ -2570,17 +2614,13 @@ def create_network_area( ).data @validate_call - def create_network_area_with_http_info( + def create_image_with_http_info( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - create_network_area_payload: Annotated[ - CreateNetworkAreaPayload, Field(description="Request an Area creation.") + 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)], @@ -2590,15 +2630,15 @@ def create_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]: - """Create new network area in an organization. + ) -> ApiResponse[ImageCreateResponse]: + """Create new Image. - Create a new network area in an organization. + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param create_network_area_payload: Request an Area creation. (required) - :type create_network_area_payload: CreateNetworkAreaPayload + :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 @@ -2621,9 +2661,9 @@ def create_network_area_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_serialize( - organization_id=organization_id, - create_network_area_payload=create_network_area_payload, + _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, @@ -2631,11 +2671,12 @@ def create_network_area_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "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) @@ -2646,17 +2687,13 @@ def create_network_area_with_http_info( ) @validate_call - def create_network_area_without_preload_content( + def create_image_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - create_network_area_payload: Annotated[ - CreateNetworkAreaPayload, Field(description="Request an Area creation.") + 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)], @@ -2667,14 +2704,14 @@ def create_network_area_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new network area in an organization. + """Create new Image. - Create a new network area in an organization. + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param create_network_area_payload: Request an Area creation. (required) - :type create_network_area_payload: CreateNetworkAreaPayload + :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 @@ -2697,9 +2734,9 @@ def create_network_area_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_serialize( - organization_id=organization_id, - create_network_area_payload=create_network_area_payload, + _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, @@ -2707,20 +2744,21 @@ def create_network_area_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "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_network_area_serialize( + def _create_image_serialize( self, - organization_id, - create_network_area_payload, + project_id, + create_image_payload, _request_auth, _content_type, _headers, @@ -2739,14 +2777,14 @@ def _create_network_area_serialize( _body_params: Optional[bytes] = None # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id + 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_network_area_payload is not None: - _body_params = create_network_area_payload + if create_image_payload is not None: + _body_params = create_image_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -2765,7 +2803,7 @@ def _create_network_area_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/organizations/{organizationId}/network-areas", + resource_path="/v1beta1/projects/{projectId}/images", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2779,23 +2817,9 @@ def _create_network_area_serialize( ) @validate_call - def create_network_area_range( + def create_key_pair( 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[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - create_network_area_range_payload: Annotated[ - CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an area.") - ], + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2805,17 +2829,13 @@ def create_network_area_range( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkRangeListResponse: - """Create new network range in a network area. + ) -> Keypair: + """Import a public key. - Create a new network range in an existing network area. + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. - :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 create_network_area_range_payload: Request an addition of network ranges to an area. (required) - :type create_network_area_range_payload: CreateNetworkAreaRangePayload + :param create_key_pair_payload: Request a public key import. (required) + :type create_key_pair_payload: CreateKeyPairPayload :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 @@ -2838,10 +2858,8 @@ def create_network_area_range( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - create_network_area_range_payload=create_network_area_range_payload, + _param = self._create_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2849,7 +2867,7 @@ def create_network_area_range( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "201": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -2865,23 +2883,9 @@ def create_network_area_range( ).data @validate_call - def create_network_area_range_with_http_info( + def create_key_pair_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[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - create_network_area_range_payload: Annotated[ - CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an area.") - ], + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2891,17 +2895,13 @@ def create_network_area_range_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[NetworkRangeListResponse]: - """Create new network range in a network area. + ) -> ApiResponse[Keypair]: + """Import a public key. - Create a new network range in an existing network area. + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. - :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 create_network_area_range_payload: Request an addition of network ranges to an area. (required) - :type create_network_area_range_payload: CreateNetworkAreaRangePayload + :param create_key_pair_payload: Request a public key import. (required) + :type create_key_pair_payload: CreateKeyPairPayload :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 @@ -2924,10 +2924,8 @@ def create_network_area_range_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - create_network_area_range_payload=create_network_area_range_payload, + _param = self._create_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2935,7 +2933,7 @@ def create_network_area_range_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "201": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -2951,23 +2949,9 @@ def create_network_area_range_with_http_info( ) @validate_call - def create_network_area_range_without_preload_content( + def create_key_pair_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[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - create_network_area_range_payload: Annotated[ - CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an area.") - ], + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2978,16 +2962,12 @@ def create_network_area_range_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new network range in a network area. + """Import a public key. - Create a new network range in an existing network area. + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. - :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 create_network_area_range_payload: Request an addition of network ranges to an area. (required) - :type create_network_area_range_payload: CreateNetworkAreaRangePayload + :param create_key_pair_payload: Request a public key import. (required) + :type create_key_pair_payload: CreateKeyPairPayload :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 @@ -3010,10 +2990,8 @@ def create_network_area_range_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - create_network_area_range_payload=create_network_area_range_payload, + _param = self._create_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3021,7 +2999,7 @@ def create_network_area_range_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "201": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -3032,11 +3010,9 @@ def create_network_area_range_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_network_area_range_serialize( + def _create_key_pair_serialize( self, - organization_id, - area_id, - create_network_area_range_payload, + create_key_pair_payload, _request_auth, _content_type, _headers, @@ -3055,16 +3031,12 @@ def _create_network_area_range_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 # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_network_area_range_payload is not None: - _body_params = create_network_area_range_payload + if create_key_pair_payload is not None: + _body_params = create_key_pair_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3083,7 +3055,7 @@ def _create_network_area_range_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", + resource_path="/v1beta1/keypairs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3097,23 +3069,13 @@ def _create_network_area_range_serialize( ) @validate_call - def create_network_area_route( + def create_network( 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." - ), - ], - create_network_area_route_payload: Annotated[ - CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3123,17 +3085,15 @@ def create_network_area_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RouteListResponse: - """Create new network routes. + ) -> Network: + """Create new network. - Create one or several new network routes in a network area. + Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. - :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 create_network_area_route_payload: Request an addition of routes to an area. (required) - :type create_network_area_route_payload: CreateNetworkAreaRoutePayload + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_network_payload: Request a network creation. (required) + :type create_network_payload: CreateNetworkPayload :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 @@ -3156,10 +3116,9 @@ def create_network_area_route( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - create_network_area_route_payload=create_network_area_route_payload, + _param = self._create_network_serialize( + project_id=project_id, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3167,7 +3126,7 @@ def create_network_area_route( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "RouteListResponse", + "202": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -3183,23 +3142,13 @@ def create_network_area_route( ).data @validate_call - def create_network_area_route_with_http_info( + def create_network_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." - ), - ], - create_network_area_route_payload: Annotated[ - CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3209,17 +3158,15 @@ def create_network_area_route_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[RouteListResponse]: - """Create new network routes. + ) -> ApiResponse[Network]: + """Create new network. - Create one or several new network routes in a network area. + Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. - :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 create_network_area_route_payload: Request an addition of routes to an area. (required) - :type create_network_area_route_payload: CreateNetworkAreaRoutePayload + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_network_payload: Request a network creation. (required) + :type create_network_payload: CreateNetworkPayload :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 @@ -3242,10 +3189,9 @@ def create_network_area_route_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - create_network_area_route_payload=create_network_area_route_payload, + _param = self._create_network_serialize( + project_id=project_id, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3253,7 +3199,7 @@ def create_network_area_route_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "RouteListResponse", + "202": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -3269,23 +3215,13 @@ def create_network_area_route_with_http_info( ) @validate_call - def create_network_area_route_without_preload_content( + def create_network_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." - ), - ], - create_network_area_route_payload: Annotated[ - CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3296,16 +3232,14 @@ def create_network_area_route_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new network routes. + """Create new network. - Create one or several new network routes in a network area. + Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. - :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 create_network_area_route_payload: Request an addition of routes to an area. (required) - :type create_network_area_route_payload: CreateNetworkAreaRoutePayload + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_network_payload: Request a network creation. (required) + :type create_network_payload: CreateNetworkPayload :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 @@ -3328,10 +3262,9 @@ def create_network_area_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - create_network_area_route_payload=create_network_area_route_payload, + _param = self._create_network_serialize( + project_id=project_id, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3339,7 +3272,7 @@ def create_network_area_route_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "RouteListResponse", + "202": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -3350,11 +3283,10 @@ def create_network_area_route_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_network_area_route_serialize( + def _create_network_serialize( self, - organization_id, - area_id, - create_network_area_route_payload, + project_id, + create_network_payload, _request_auth, _content_type, _headers, @@ -3373,16 +3305,14 @@ def _create_network_area_route_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 # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_network_area_route_payload is not None: - _body_params = create_network_area_route_payload + if create_network_payload is not None: + _body_params = create_network_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3401,7 +3331,7 @@ def _create_network_area_route_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes", + resource_path="/v1beta1/projects/{projectId}/networks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3415,17 +3345,17 @@ def _create_network_area_route_serialize( ) @validate_call - def create_nic( + def create_network_area( 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." + ), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + create_network_area_payload: Annotated[ + CreateNetworkAreaPayload, Field(description="Request an Area creation.") ], - create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3435,17 +3365,15 @@ def create_nic( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NIC: - """Create new network interface. + ) -> NetworkArea: + """Create new network area in an organization. - Create a new network interface in a project. + Create a new network area in an organization. - :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 create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNicPayload + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param create_network_area_payload: Request an Area creation. (required) + :type create_network_area_payload: CreateNetworkAreaPayload :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 @@ -3468,10 +3396,9 @@ def create_nic( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_nic_serialize( - project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, + _param = self._create_network_area_serialize( + organization_id=organization_id, + create_network_area_payload=create_network_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3479,13 +3406,11 @@ def create_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "NIC", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", - "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3496,17 +3421,17 @@ def create_nic( ).data @validate_call - def create_nic_with_http_info( + def create_network_area_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." + ), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + create_network_area_payload: Annotated[ + CreateNetworkAreaPayload, Field(description="Request an Area creation.") ], - create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3516,17 +3441,15 @@ def create_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]: - """Create new network interface. + ) -> ApiResponse[NetworkArea]: + """Create new network area in an organization. - Create a new network interface in a project. + Create a new network area in an organization. - :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 create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNicPayload + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param create_network_area_payload: Request an Area creation. (required) + :type create_network_area_payload: CreateNetworkAreaPayload :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 @@ -3549,10 +3472,9 @@ def create_nic_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_nic_serialize( - project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, + _param = self._create_network_area_serialize( + organization_id=organization_id, + create_network_area_payload=create_network_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3560,13 +3482,11 @@ def create_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "NIC", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", - "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3577,17 +3497,17 @@ def create_nic_with_http_info( ) @validate_call - def create_nic_without_preload_content( + def create_network_area_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." + ), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + create_network_area_payload: Annotated[ + CreateNetworkAreaPayload, Field(description="Request an Area creation.") ], - create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3598,16 +3518,14 @@ def create_nic_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new network interface. + """Create new network area in an organization. - Create a new network interface in a project. + Create a new network area in an organization. - :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 create_nic_payload: Request a network interface creation. (required) - :type create_nic_payload: CreateNicPayload + :param organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_id: str + :param create_network_area_payload: Request an Area creation. (required) + :type create_network_area_payload: CreateNetworkAreaPayload :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 @@ -3630,10 +3548,9 @@ def create_nic_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_nic_serialize( - project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, + _param = self._create_network_area_serialize( + organization_id=organization_id, + create_network_area_payload=create_network_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3641,23 +3558,20 @@ def create_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "NIC", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", - "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_nic_serialize( + def _create_network_area_serialize( self, - project_id, - network_id, - create_nic_payload, + organization_id, + create_network_area_payload, _request_auth, _content_type, _headers, @@ -3676,16 +3590,14 @@ def _create_nic_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 organization_id is not None: + _path_params["organizationId"] = organization_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_nic_payload is not None: - _body_params = create_nic_payload + if create_network_area_payload is not None: + _body_params = create_network_area_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3704,7 +3616,7 @@ def _create_nic_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics", + resource_path="/v1beta1/organizations/{organizationId}/network-areas", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3718,13 +3630,23 @@ def _create_nic_serialize( ) @validate_call - def create_public_ip( + def create_network_area_range( 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." + ), + ], + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + create_network_area_range_payload: Annotated[ + CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an area.") ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3734,15 +3656,17 @@ def create_public_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PublicIp: - """Create new public IP. + ) -> NetworkRangeListResponse: + """Create new network range in a network area. - Create a new public IP in a project. + Create a new network range in an existing network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_public_ip_payload: Request a public IP creation. (required) - :type create_public_ip_payload: CreatePublicIPPayload + :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 create_network_area_range_payload: Request an addition of network ranges to an area. (required) + :type create_network_area_range_payload: CreateNetworkAreaRangePayload :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 @@ -3765,9 +3689,10 @@ def create_public_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_public_ip_serialize( - project_id=project_id, - create_public_ip_payload=create_public_ip_payload, + _param = self._create_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + create_network_area_range_payload=create_network_area_range_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3775,12 +3700,12 @@ def create_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "429": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3791,13 +3716,23 @@ def create_public_ip( ).data @validate_call - def create_public_ip_with_http_info( + def create_network_area_range_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." + ), + ], + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + create_network_area_range_payload: Annotated[ + CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an area.") ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3807,15 +3742,17 @@ def create_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]: - """Create new public IP. + ) -> ApiResponse[NetworkRangeListResponse]: + """Create new network range in a network area. - Create a new public IP in a project. + Create a new network range in an existing network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_public_ip_payload: Request a public IP creation. (required) - :type create_public_ip_payload: CreatePublicIPPayload + :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 create_network_area_range_payload: Request an addition of network ranges to an area. (required) + :type create_network_area_range_payload: CreateNetworkAreaRangePayload :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 @@ -3838,9 +3775,10 @@ def create_public_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_public_ip_serialize( - project_id=project_id, - create_public_ip_payload=create_public_ip_payload, + _param = self._create_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + create_network_area_range_payload=create_network_area_range_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3848,12 +3786,12 @@ def create_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "429": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3864,13 +3802,23 @@ def create_public_ip_with_http_info( ) @validate_call - def create_public_ip_without_preload_content( + def create_network_area_range_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." + ), + ], + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + create_network_area_range_payload: Annotated[ + CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an area.") ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3881,14 +3829,16 @@ def create_public_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new public IP. + """Create new network range in a network area. - Create a new public IP in a project. + Create a new network range in an existing network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_public_ip_payload: Request a public IP creation. (required) - :type create_public_ip_payload: CreatePublicIPPayload + :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 create_network_area_range_payload: Request an addition of network ranges to an area. (required) + :type create_network_area_range_payload: CreateNetworkAreaRangePayload :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 @@ -3911,9 +3861,10 @@ def create_public_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_public_ip_serialize( - project_id=project_id, - create_public_ip_payload=create_public_ip_payload, + _param = self._create_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + create_network_area_range_payload=create_network_area_range_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3921,21 +3872,22 @@ def create_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "429": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_public_ip_serialize( + def _create_network_area_range_serialize( self, - project_id, - create_public_ip_payload, + organization_id, + area_id, + create_network_area_range_payload, _request_auth, _content_type, _headers, @@ -3954,14 +3906,16 @@ def _create_public_ip_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 area_id is not None: + _path_params["areaId"] = area_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_public_ip_payload is not None: - _body_params = create_public_ip_payload + if create_network_area_range_payload is not None: + _body_params = create_network_area_range_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3980,7 +3934,7 @@ def _create_public_ip_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/public-ips", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3994,14 +3948,22 @@ def _create_public_ip_serialize( ) @validate_call - def create_security_group( + def create_network_area_route( 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." + ), ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group creation.") + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + create_network_area_route_payload: Annotated[ + CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") ], _request_timeout: Union[ None, @@ -4012,15 +3974,17 @@ def create_security_group( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroup: - """Create new security group. + ) -> RouteListResponse: + """Create new network routes. - Create a new security group in a project. + Create one or several new network routes in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_security_group_payload: Request a security group creation. (required) - :type create_security_group_payload: CreateSecurityGroupPayload + :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 create_network_area_route_payload: Request an addition of routes to an area. (required) + :type create_network_area_route_payload: CreateNetworkAreaRoutePayload :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 @@ -4043,9 +4007,10 @@ def create_security_group( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_security_group_serialize( - project_id=project_id, - create_security_group_payload=create_security_group_payload, + _param = self._create_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + create_network_area_route_payload=create_network_area_route_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4053,11 +4018,12 @@ def create_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroup", + "202": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4068,14 +4034,22 @@ def create_security_group( ).data @validate_call - def create_security_group_with_http_info( + def create_network_area_route_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." + ), ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group creation.") + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + create_network_area_route_payload: Annotated[ + CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") ], _request_timeout: Union[ None, @@ -4086,15 +4060,17 @@ def create_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]: - """Create new security group. + ) -> ApiResponse[RouteListResponse]: + """Create new network routes. - Create a new security group in a project. + Create one or several new network routes in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_security_group_payload: Request a security group creation. (required) - :type create_security_group_payload: CreateSecurityGroupPayload + :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 create_network_area_route_payload: Request an addition of routes to an area. (required) + :type create_network_area_route_payload: CreateNetworkAreaRoutePayload :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 @@ -4117,9 +4093,10 @@ def create_security_group_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_security_group_serialize( - project_id=project_id, - create_security_group_payload=create_security_group_payload, + _param = self._create_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + create_network_area_route_payload=create_network_area_route_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4127,11 +4104,12 @@ def create_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroup", + "202": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4142,14 +4120,22 @@ def create_security_group_with_http_info( ) @validate_call - def create_security_group_without_preload_content( + def create_network_area_route_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." + ), ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group creation.") + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + create_network_area_route_payload: Annotated[ + CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") ], _request_timeout: Union[ None, @@ -4161,14 +4147,16 @@ def create_security_group_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new security group. + """Create new network routes. - Create a new security group in a project. + Create one or several new network routes in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_security_group_payload: Request a security group creation. (required) - :type create_security_group_payload: CreateSecurityGroupPayload + :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 create_network_area_route_payload: Request an addition of routes to an area. (required) + :type create_network_area_route_payload: CreateNetworkAreaRoutePayload :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 @@ -4191,9 +4179,10 @@ def create_security_group_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_security_group_serialize( - project_id=project_id, - create_security_group_payload=create_security_group_payload, + _param = self._create_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + create_network_area_route_payload=create_network_area_route_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4201,20 +4190,22 @@ def create_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroup", + "202": "RouteListResponse", "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 _create_security_group_serialize( + def _create_network_area_route_serialize( self, - project_id, - create_security_group_payload, + organization_id, + area_id, + create_network_area_route_payload, _request_auth, _content_type, _headers, @@ -4233,14 +4224,16 @@ def _create_security_group_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 area_id is not None: + _path_params["areaId"] = area_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_security_group_payload is not None: - _body_params = create_security_group_payload + if create_network_area_route_payload is not None: + _body_params = create_network_area_route_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -4259,7 +4252,7 @@ def _create_security_group_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/security-groups", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4273,24 +4266,17 @@ def _create_security_group_serialize( ) @validate_call - def create_security_group_rule( + def create_nic( 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[ + network_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - create_security_group_rule_payload: Annotated[ - CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") + 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.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4300,17 +4286,17 @@ def create_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: - """Create new security group rule. + ) -> NIC: + """Create new network interface. - Create a new security group rule in a project. + Create a new network interface in 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 create_security_group_rule_payload: Request for a security group rule creation. (required) - :type create_security_group_rule_payload: CreateSecurityGroupRulePayload + :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 :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 @@ -4333,10 +4319,10 @@ def create_security_group_rule( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_security_group_rule_serialize( + _param = self._create_nic_serialize( project_id=project_id, - security_group_id=security_group_id, - create_security_group_rule_payload=create_security_group_rule_payload, + network_id=network_id, + create_nic_payload=create_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4344,11 +4330,13 @@ def create_security_group_rule( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroupRule", + "201": "NIC", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", + "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4359,24 +4347,17 @@ def create_security_group_rule( ).data @validate_call - def create_security_group_rule_with_http_info( + def create_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."), ], - security_group_id: Annotated[ + network_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - create_security_group_rule_payload: Annotated[ - CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") + 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.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4386,17 +4367,17 @@ def create_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]: - """Create new security group rule. + ) -> ApiResponse[NIC]: + """Create new network interface. - Create a new security group rule in a project. + Create a new network interface in 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 create_security_group_rule_payload: Request for a security group rule creation. (required) - :type create_security_group_rule_payload: CreateSecurityGroupRulePayload + :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 :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 @@ -4419,10 +4400,10 @@ def create_security_group_rule_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_security_group_rule_serialize( + _param = self._create_nic_serialize( project_id=project_id, - security_group_id=security_group_id, - create_security_group_rule_payload=create_security_group_rule_payload, + network_id=network_id, + create_nic_payload=create_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4430,11 +4411,13 @@ def create_security_group_rule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroupRule", + "201": "NIC", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", + "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4445,24 +4428,17 @@ def create_security_group_rule_with_http_info( ) @validate_call - def create_security_group_rule_without_preload_content( + def create_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."), ], - security_group_id: Annotated[ + network_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - create_security_group_rule_payload: Annotated[ - CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") + 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.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4473,16 +4449,16 @@ def create_security_group_rule_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new security group rule. + """Create new network interface. - Create a new security group rule in a project. + Create a new network interface in 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 create_security_group_rule_payload: Request for a security group rule creation. (required) - :type create_security_group_rule_payload: CreateSecurityGroupRulePayload + :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 :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 @@ -4505,10 +4481,10 @@ def create_security_group_rule_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_security_group_rule_serialize( + _param = self._create_nic_serialize( project_id=project_id, - security_group_id=security_group_id, - create_security_group_rule_payload=create_security_group_rule_payload, + network_id=network_id, + create_nic_payload=create_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4516,21 +4492,23 @@ def create_security_group_rule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroupRule", + "201": "NIC", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", + "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_security_group_rule_serialize( + def _create_nic_serialize( self, project_id, - security_group_id, - create_security_group_rule_payload, + network_id, + create_nic_payload, _request_auth, _content_type, _headers, @@ -4551,14 +4529,14 @@ def _create_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 network_id is not None: + _path_params["networkId"] = network_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_security_group_rule_payload is not None: - _body_params = create_security_group_rule_payload + if create_nic_payload is not None: + _body_params = create_nic_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -4577,7 +4555,7 @@ def _create_security_group_rule_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules", + resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4591,13 +4569,13 @@ def _create_security_group_rule_serialize( ) @validate_call - def create_server( + def create_public_ip( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], + create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4607,15 +4585,15 @@ def create_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Server: - """Create new server. + ) -> PublicIp: + """Create new public IP. - Create a new server in a project. + Create a new public IP in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload + :param create_public_ip_payload: Request a public IP creation. (required) + :type create_public_ip_payload: CreatePublicIPPayload :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 @@ -4638,9 +4616,9 @@ def create_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_server_serialize( + _param = self._create_public_ip_serialize( project_id=project_id, - create_server_payload=create_server_payload, + create_public_ip_payload=create_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4648,11 +4626,12 @@ def create_server( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Server", + "201": "PublicIp", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4663,13 +4642,13 @@ def create_server( ).data @validate_call - def create_server_with_http_info( + def create_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."), ], - create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], + create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4679,15 +4658,15 @@ def create_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]: - """Create new server. + ) -> ApiResponse[PublicIp]: + """Create new public IP. - Create a new server in a project. + Create a new public IP in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload + :param create_public_ip_payload: Request a public IP creation. (required) + :type create_public_ip_payload: CreatePublicIPPayload :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 @@ -4710,9 +4689,9 @@ def create_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_server_serialize( + _param = self._create_public_ip_serialize( project_id=project_id, - create_server_payload=create_server_payload, + create_public_ip_payload=create_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4720,11 +4699,12 @@ def create_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Server", + "201": "PublicIp", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4735,13 +4715,13 @@ def create_server_with_http_info( ) @validate_call - def create_server_without_preload_content( + def create_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."), ], - create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], + create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4752,14 +4732,14 @@ def create_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new server. + """Create new public IP. - Create a new server in a project. + Create a new public IP in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload + :param create_public_ip_payload: Request a public IP creation. (required) + :type create_public_ip_payload: CreatePublicIPPayload :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 @@ -4782,9 +4762,9 @@ def create_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_server_serialize( + _param = self._create_public_ip_serialize( project_id=project_id, - create_server_payload=create_server_payload, + create_public_ip_payload=create_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4792,20 +4772,21 @@ def create_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Server", + "201": "PublicIp", "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_server_serialize( + def _create_public_ip_serialize( self, project_id, - create_server_payload, + create_public_ip_payload, _request_auth, _content_type, _headers, @@ -4830,8 +4811,8 @@ def _create_server_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_server_payload is not None: - _body_params = create_server_payload + if create_public_ip_payload is not None: + _body_params = create_public_ip_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -4850,7 +4831,7 @@ def _create_server_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/servers", + resource_path="/v1beta1/projects/{projectId}/public-ips", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4864,13 +4845,15 @@ def _create_server_serialize( ) @validate_call - def create_volume( + def create_security_group( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], + create_security_group_payload: Annotated[ + CreateSecurityGroupPayload, Field(description="Request a security group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4880,15 +4863,15 @@ def create_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Volume: - """Create new volume. + ) -> SecurityGroup: + """Create new security group. - Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + Create a new security group in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_volume_payload: Request a volume creation. (required) - :type create_volume_payload: CreateVolumePayload + :param create_security_group_payload: Request a security group creation. (required) + :type create_security_group_payload: CreateSecurityGroupPayload :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 @@ -4911,9 +4894,9 @@ def create_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_volume_serialize( + _param = self._create_security_group_serialize( project_id=project_id, - create_volume_payload=create_volume_payload, + create_security_group_payload=create_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4921,7 +4904,7 @@ def create_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", + "201": "SecurityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -4936,13 +4919,15 @@ def create_volume( ).data @validate_call - def create_volume_with_http_info( + def create_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."), ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], + create_security_group_payload: Annotated[ + CreateSecurityGroupPayload, Field(description="Request a security group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4952,15 +4937,15 @@ def create_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]: - """Create new volume. + ) -> ApiResponse[SecurityGroup]: + """Create new security group. - Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + Create a new security group in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_volume_payload: Request a volume creation. (required) - :type create_volume_payload: CreateVolumePayload + :param create_security_group_payload: Request a security group creation. (required) + :type create_security_group_payload: CreateSecurityGroupPayload :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 @@ -4983,9 +4968,9 @@ def create_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_volume_serialize( + _param = self._create_security_group_serialize( project_id=project_id, - create_volume_payload=create_volume_payload, + create_security_group_payload=create_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4993,7 +4978,7 @@ def create_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", + "201": "SecurityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -5008,13 +4993,15 @@ def create_volume_with_http_info( ) @validate_call - def create_volume_without_preload_content( + def create_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."), ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], + create_security_group_payload: Annotated[ + CreateSecurityGroupPayload, Field(description="Request a security group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5025,14 +5012,14 @@ def create_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new volume. + """Create new security group. - Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + Create a new security group in a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param create_volume_payload: Request a volume creation. (required) - :type create_volume_payload: CreateVolumePayload + :param create_security_group_payload: Request a security group creation. (required) + :type create_security_group_payload: CreateSecurityGroupPayload :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 @@ -5055,9 +5042,9 @@ def create_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_volume_serialize( + _param = self._create_security_group_serialize( project_id=project_id, - create_volume_payload=create_volume_payload, + create_security_group_payload=create_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5065,7 +5052,7 @@ def create_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", + "201": "SecurityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -5075,10 +5062,10 @@ def create_volume_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_volume_serialize( + def _create_security_group_serialize( self, project_id, - create_volume_payload, + create_security_group_payload, _request_auth, _content_type, _headers, @@ -5103,8 +5090,8 @@ def _create_volume_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_volume_payload is not None: - _body_params = create_volume_payload + if create_security_group_payload is not None: + _body_params = create_security_group_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -5123,7 +5110,7 @@ def _create_volume_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta1/projects/{projectId}/volumes", + resource_path="/v1beta1/projects/{projectId}/security-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5137,15 +5124,23 @@ def _create_volume_serialize( ) @validate_call - def deallocate_server( + def create_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."), ], - server_id: Annotated[ + security_group_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 Security Group.", + ), + ], + create_security_group_rule_payload: Annotated[ + CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") ], _request_timeout: Union[ None, @@ -5156,15 +5151,17 @@ def deallocate_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Deallocate an existing server. + ) -> SecurityGroupRule: + """Create new security group rule. - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + Create a new security group rule in 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param create_security_group_rule_payload: Request for a security group rule creation. (required) + :type create_security_group_rule_payload: CreateSecurityGroupRulePayload :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 @@ -5187,9 +5184,10 @@ def deallocate_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._deallocate_server_serialize( + _param = self._create_security_group_rule_serialize( project_id=project_id, - server_id=server_id, + security_group_id=security_group_id, + create_security_group_rule_payload=create_security_group_rule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5197,12 +5195,11 @@ def deallocate_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "SecurityGroupRule", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5213,15 +5210,23 @@ def deallocate_server( ).data @validate_call - def deallocate_server_with_http_info( + def create_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."), ], - server_id: Annotated[ + security_group_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 Security Group.", + ), + ], + create_security_group_rule_payload: Annotated[ + CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") ], _request_timeout: Union[ None, @@ -5232,15 +5237,17 @@ def deallocate_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[None]: - """Deallocate an existing server. + ) -> ApiResponse[SecurityGroupRule]: + """Create new security group rule. - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + Create a new security group rule in 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param create_security_group_rule_payload: Request for a security group rule creation. (required) + :type create_security_group_rule_payload: CreateSecurityGroupRulePayload :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 @@ -5263,9 +5270,10 @@ def deallocate_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._deallocate_server_serialize( + _param = self._create_security_group_rule_serialize( project_id=project_id, - server_id=server_id, + security_group_id=security_group_id, + create_security_group_rule_payload=create_security_group_rule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5273,12 +5281,11 @@ def deallocate_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "SecurityGroupRule", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5289,15 +5296,23 @@ def deallocate_server_with_http_info( ) @validate_call - def deallocate_server_without_preload_content( + def create_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."), ], - server_id: Annotated[ + security_group_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 Security Group.", + ), + ], + create_security_group_rule_payload: Annotated[ + CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") ], _request_timeout: Union[ None, @@ -5309,14 +5324,16 @@ def deallocate_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Deallocate an existing server. + """Create new security group rule. - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + Create a new security group rule in 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param create_security_group_rule_payload: Request for a security group rule creation. (required) + :type create_security_group_rule_payload: CreateSecurityGroupRulePayload :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 @@ -5339,31 +5356,32 @@ def deallocate_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._deallocate_server_serialize( + _param = self._create_security_group_rule_serialize( project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, + security_group_id=security_group_id, + create_security_group_rule_payload=create_security_group_rule_payload, + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "SecurityGroupRule", "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 _deallocate_server_serialize( + def _create_security_group_rule_serialize( self, project_id, - server_id, + security_group_id, + create_security_group_rule_payload, _request_auth, _content_type, _headers, @@ -5384,23 +5402,33 @@ def _deallocate_server_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 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 + if create_security_group_rule_payload is not None: + _body_params = create_security_group_rule_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="/v1beta1/projects/{projectId}/servers/{serverId}/deallocate", + resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5414,9 +5442,13 @@ def _deallocate_server_serialize( ) @validate_call - def delete_key_pair( + def create_server( 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."), + ], + create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5426,13 +5458,15 @@ def delete_key_pair( _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. + ) -> Server: + """Create new server. - Delete an SSH keypair from a user. + Create a new server in 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 create_server_payload: Request a server creation. (required) + :type create_server_payload: CreateServerPayload :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 @@ -5455,8 +5489,9 @@ def delete_key_pair( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_key_pair_serialize( - keypair_name=keypair_name, + _param = self._create_server_serialize( + project_id=project_id, + create_server_payload=create_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5464,7 +5499,7 @@ def delete_key_pair( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -5479,9 +5514,13 @@ def delete_key_pair( ).data @validate_call - def delete_key_pair_with_http_info( + def create_server_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."), + ], + create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5491,13 +5530,15 @@ def delete_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[None]: - """Delete an SSH keypair. + ) -> ApiResponse[Server]: + """Create new server. - Delete an SSH keypair from a user. + Create a new server in 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 create_server_payload: Request a server creation. (required) + :type create_server_payload: CreateServerPayload :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 @@ -5520,8 +5561,9 @@ def delete_key_pair_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_key_pair_serialize( - keypair_name=keypair_name, + _param = self._create_server_serialize( + project_id=project_id, + create_server_payload=create_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5529,7 +5571,7 @@ def delete_key_pair_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -5544,9 +5586,13 @@ def delete_key_pair_with_http_info( ) @validate_call - def delete_key_pair_without_preload_content( + def create_server_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."), + ], + create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5557,12 +5603,14 @@ def delete_key_pair_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete an SSH keypair. + """Create new server. - Delete an SSH keypair from a user. + Create a new server in 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 create_server_payload: Request a server creation. (required) + :type create_server_payload: CreateServerPayload :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 @@ -5585,8 +5633,9 @@ def delete_key_pair_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_key_pair_serialize( - keypair_name=keypair_name, + _param = self._create_server_serialize( + project_id=project_id, + create_server_payload=create_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5594,7 +5643,7 @@ def delete_key_pair_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -5604,9 +5653,10 @@ def delete_key_pair_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_key_pair_serialize( + def _create_server_serialize( self, - keypair_name, + project_id, + create_server_payload, _request_auth, _content_type, _headers, @@ -5625,23 +5675,33 @@ def _delete_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 # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_server_payload is not None: + _body_params = create_server_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="DELETE", - resource_path="/v1beta1/keypairs/{keypairName}", + method="POST", + resource_path="/v1beta1/projects/{projectId}/servers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5655,16 +5715,13 @@ def _delete_key_pair_serialize( ) @validate_call - def delete_network( + def create_snapshot( 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."), - ], + create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5674,15 +5731,15 @@ def delete_network( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete network. + ) -> Snapshot: + """Create new Snapshot. - Delete a network. If the network is still in use, the deletion will fail. + Create a new Snapshot from a Volume in 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 create_snapshot_payload: Request a snapshot creation. (required) + :type create_snapshot_payload: CreateSnapshotPayload :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 @@ -5705,9 +5762,9 @@ def delete_network( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_serialize( + _param = self._create_snapshot_serialize( project_id=project_id, - network_id=network_id, + create_snapshot_payload=create_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5715,12 +5772,11 @@ def delete_network( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "Snapshot", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5731,16 +5787,13 @@ def delete_network( ).data @validate_call - def delete_network_with_http_info( + def create_snapshot_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."), - ], + create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5750,15 +5803,15 @@ def delete_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[None]: - """Delete network. + ) -> ApiResponse[Snapshot]: + """Create new Snapshot. - Delete a network. If the network is still in use, the deletion will fail. + Create a new Snapshot from a Volume in 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 create_snapshot_payload: Request a snapshot creation. (required) + :type create_snapshot_payload: CreateSnapshotPayload :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 @@ -5781,9 +5834,9 @@ def delete_network_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_serialize( + _param = self._create_snapshot_serialize( project_id=project_id, - network_id=network_id, + create_snapshot_payload=create_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5791,12 +5844,11 @@ def delete_network_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "Snapshot", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5807,16 +5859,13 @@ def delete_network_with_http_info( ) @validate_call - def delete_network_without_preload_content( + def create_snapshot_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."), - ], + create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5827,14 +5876,14 @@ def delete_network_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete network. + """Create new Snapshot. - Delete a network. If the network is still in use, the deletion will fail. + Create a new Snapshot from a Volume in 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 create_snapshot_payload: Request a snapshot creation. (required) + :type create_snapshot_payload: CreateSnapshotPayload :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 @@ -5857,9 +5906,9 @@ def delete_network_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_serialize( + _param = self._create_snapshot_serialize( project_id=project_id, - network_id=network_id, + create_snapshot_payload=create_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5867,21 +5916,20 @@ def delete_network_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "Snapshot", "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 _delete_network_serialize( + def _create_snapshot_serialize( self, project_id, - network_id, + create_snapshot_payload, _request_auth, _content_type, _headers, @@ -5902,23 +5950,31 @@ def _delete_network_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 # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_snapshot_payload is not None: + _body_params = create_snapshot_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="DELETE", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}", + method="POST", + resource_path="/v1beta1/projects/{projectId}/snapshots", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5932,20 +5988,13 @@ def _delete_network_serialize( ) @validate_call - def delete_network_area( + def create_volume( 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."), ], + create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5955,15 +6004,15 @@ def delete_network_area( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a network area. + ) -> Volume: + """Create new volume. - Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. - :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 create_volume_payload: Request a volume creation. (required) + :type create_volume_payload: CreateVolumePayload :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 @@ -5986,9 +6035,9 @@ def delete_network_area( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._create_volume_serialize( + project_id=project_id, + create_volume_payload=create_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5996,12 +6045,11 @@ def delete_network_area( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "Volume", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6012,20 +6060,13 @@ def delete_network_area( ).data @validate_call - def delete_network_area_with_http_info( + def create_volume_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."), ], + create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6035,15 +6076,8865 @@ def delete_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[None]: - """Delete a network area. + ) -> ApiResponse[Volume]: + """Create new volume. - Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. - :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 create_volume_payload: Request a volume creation. (required) + :type create_volume_payload: CreateVolumePayload + :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_volume_serialize( + project_id=project_id, + create_volume_payload=create_volume_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Volume", + "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 create_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."), + ], + create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume 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 volume. + + Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param create_volume_payload: Request a volume creation. (required) + :type create_volume_payload: CreateVolumePayload + :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_volume_serialize( + project_id=project_id, + create_volume_payload=create_volume_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "Volume", + "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 _create_volume_serialize( + self, + project_id, + create_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]] = {} + _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_volume_payload is not None: + _body_params = create_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="/v1beta1/projects/{projectId}/volumes", + 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 deallocate_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."), + ], + _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: + """Deallocate an existing server. + + Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + :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._deallocate_server_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]] = { + "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 deallocate_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."), + ], + _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]: + """Deallocate an existing server. + + Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + :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._deallocate_server_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]] = { + "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 deallocate_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."), + ], + _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: + """Deallocate an existing server. + + Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + :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._deallocate_server_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]] = { + "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 _deallocate_server_serialize( + self, + project_id, + server_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 server_id is not None: + _path_params["serverId"] = server_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="POST", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/deallocate", + 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_affinity_group( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + affinity_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity 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, + ) -> None: + """Delete a affinity group in a project. + + Delete a affinity group in the given project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) + :type affinity_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._delete_affinity_group_serialize( + project_id=project_id, + affinity_group_id=affinity_group_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_affinity_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."), + ], + affinity_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity 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, + ) -> ApiResponse[None]: + """Delete a affinity group in a project. + + Delete a affinity group in the given project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) + :type affinity_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._delete_affinity_group_serialize( + project_id=project_id, + affinity_group_id=affinity_group_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_affinity_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."), + ], + affinity_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity 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: + """Delete a affinity group in a project. + + Delete a affinity group in the given project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) + :type affinity_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._delete_affinity_group_serialize( + project_id=project_id, + affinity_group_id=affinity_group_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_affinity_group_serialize( + self, + project_id, + affinity_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 affinity_group_id is not None: + _path_params["affinityGroupId"] = affinity_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="DELETE", + resource_path="/v1beta1/projects/{projectId}/affinity-groups/{affinityGroupId}", + 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_backup( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + backup_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), + ], + force: Annotated[Optional[StrictBool], Field(description="Force action.")] = 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: + """Delete a backup. + + Delete a backup that is part of the project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_id: str + :param force: Force action. + :type force: 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._delete_backup_serialize( + project_id=project_id, + backup_id=backup_id, + force=force, + _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_backup_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."), + ], + backup_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), + ], + force: Annotated[Optional[StrictBool], Field(description="Force action.")] = 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]: + """Delete a backup. + + Delete a backup that is part of the project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_id: str + :param force: Force action. + :type force: 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._delete_backup_serialize( + project_id=project_id, + backup_id=backup_id, + force=force, + _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_backup_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."), + ], + backup_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), + ], + force: Annotated[Optional[StrictBool], Field(description="Force action.")] = 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: + """Delete a backup. + + Delete a backup that is part of the project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_id: str + :param force: Force action. + :type force: 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._delete_backup_serialize( + project_id=project_id, + backup_id=backup_id, + force=force, + _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_backup_serialize( + self, + project_id, + backup_id, + force, + _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 backup_id is not None: + _path_params["backupId"] = backup_id + # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + + # 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="/v1beta1/projects/{projectId}/backups/{backupId}", + 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_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.") + ], + _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 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, + ).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="/v1beta1/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_image_share( + 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, + ) -> None: + """Remove image share. + + Remove the image share. New scope will be local. + + :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_share_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_share_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]: + """Remove image share. + + Remove the image share. New scope will be local. + + :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_share_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_share_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: + """Remove image share. + + Remove the image share. New scope will be local. + + :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_share_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_share_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="/v1beta1/projects/{projectId}/images/{imageId}/share", + 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_image_share_consumer( + 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.") + ], + consumer_project_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Project that consumes an image share.", + ), + ], + _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: + """Remove an image share consumer. + + Remove consumer from a shared image. + + :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 consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) + :type consumer_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 + (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_share_consumer_serialize( + project_id=project_id, + image_id=image_id, + consumer_project_id=consumer_project_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_share_consumer_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.") + ], + consumer_project_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Project that consumes an image share.", + ), + ], + _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]: + """Remove an image share consumer. + + Remove consumer from a shared image. + + :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 consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) + :type consumer_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 + (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_share_consumer_serialize( + project_id=project_id, + image_id=image_id, + consumer_project_id=consumer_project_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_share_consumer_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.") + ], + consumer_project_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Project that consumes an image share.", + ), + ], + _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: + """Remove an image share consumer. + + Remove consumer from a shared image. + + :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 consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) + :type consumer_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 + (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_share_consumer_serialize( + project_id=project_id, + image_id=image_id, + consumer_project_id=consumer_project_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_share_consumer_serialize( + self, + project_id, + image_id, + consumer_project_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 + if consumer_project_id is not None: + _path_params["consumerProjectId"] = consumer_project_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="/v1beta1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}", + 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, + _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_key_pair_with_http_info( + 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, + ) -> ApiResponse[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, + _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_key_pair_without_preload_content( + 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, + ) -> RESTResponseType: + """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, + _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_key_pair_serialize( + self, + keypair_name, + _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 keypair_name is not None: + _path_params["keypairName"] = keypair_name + # 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="/v1beta1/keypairs/{keypairName}", + 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_network( + 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."), + ], + _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 network. + + Delete a network. If the network is still in use, the deletion will fail. + + :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 _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_network_serialize( + project_id=project_id, + network_id=network_id, + _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 delete_network_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."), + ], + _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 network. + + Delete a network. If the network is still in use, the deletion will fail. + + :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 _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_network_serialize( + project_id=project_id, + network_id=network_id, + _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 delete_network_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."), + ], + _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 network. + + Delete a network. If the network is still in use, the deletion will fail. + + :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 _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_network_serialize( + project_id=project_id, + network_id=network_id, + _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 _delete_network_serialize( + self, + project_id, + network_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 network_id is not None: + _path_params["networkId"] = network_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="/v1beta1/projects/{projectId}/networks/{networkId}", + 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_network_area( + 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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + _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 a network area. + + Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + :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 _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_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + _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 delete_network_area_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + _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 a network area. + + Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + :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 _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_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + _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 delete_network_area_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + _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 a network area. + + Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + :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 _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_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + _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 _delete_network_area_serialize( + self, + organization_id, + area_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 organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_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="/v1beta1/organizations/{organizationId}/network-areas/{areaId}", + 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_network_area_range( + 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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + network_range_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), + ], + _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 a network range. + + Delete a network range of a network area. The deletion will fail if the network range is still used. + + :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_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_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, + _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 delete_network_area_range_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + network_range_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), + ], + _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 a network range. + + Delete a network range of a network area. The deletion will fail if the network range is still used. + + :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_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_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, + _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 delete_network_area_range_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + network_range_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), + ], + _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 a network range. + + Delete a network range of a network area. The deletion will fail if the network range is still used. + + :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_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_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, + _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 _delete_network_area_range_serialize( + self, + organization_id, + area_id, + network_range_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 organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if network_range_id is not None: + _path_params["networkRangeId"] = network_range_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="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", + 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_network_area_route( + 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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + _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 a network route. + + Delete a network route of a network area. + + :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 route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_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_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + _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", + "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_network_area_route_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + _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 a network route. + + Delete a network route of a network area. + + :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 route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_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_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + _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", + "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_network_area_route_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + _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 a network route. + + Delete a network route of a network area. + + :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 route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_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_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + _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", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_network_area_route_serialize( + self, + organization_id, + area_id, + route_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 organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if route_id is not None: + _path_params["routeId"] = route_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="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", + 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_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)], + 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 a network interface. + + Delete a network interface that is part of the 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 + (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_nic_serialize( + project_id=project_id, + network_id=network_id, + nic_id=nic_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_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)], + 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 a network interface. + + Delete a network interface that is part of the 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 + (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_nic_serialize( + project_id=project_id, + network_id=network_id, + nic_id=nic_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_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)], + 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 a network interface. + + Delete a network interface that is part of the 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 + (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_nic_serialize( + project_id=project_id, + network_id=network_id, + nic_id=nic_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_nic_serialize( + self, + project_id, + network_id, + nic_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 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 + # 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="/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + 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_public_ip( + 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)], + 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 a public IP. + + Delete a public IP that is part of the 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._delete_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]] = { + "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_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."), + ], + 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, + ) -> ApiResponse[None]: + """Delete a public IP. + + Delete a public IP that is part of the 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._delete_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]] = { + "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_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."), + ], + 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: + """Delete a public IP. + + Delete a public IP that is part of the 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._delete_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]] = { + "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_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="DELETE", + resource_path="/v1beta1/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 delete_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, + ) -> None: + """Delete security group. + + Delete a security group. + + :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._delete_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]] = { + "204": 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 delete_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.", + ), + ], + _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 security group. + + Delete a security group. + + :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._delete_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]] = { + "204": 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 delete_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: + """Delete security group. + + Delete a security group. + + :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._delete_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]] = { + "204": 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 _delete_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="DELETE", + resource_path="/v1beta1/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 delete_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, + ) -> None: + """Delete security group rule. + + Delete a security group rule. + + :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._delete_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]] = { + "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_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[None]: + """Delete security group rule. + + Delete a security group rule. + + :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._delete_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]] = { + "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_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: + """Delete security group rule. + + Delete a security group rule. + + :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._delete_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]] = { + "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_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="DELETE", + resource_path="/v1beta1/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 delete_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."), + ], + _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 a server. + + Delete a server. Volumes won't be deleted. + + :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._delete_server_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]] = { + "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_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."), + ], + _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 a server. + + Delete a server. Volumes won't be deleted. + + :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._delete_server_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]] = { + "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_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."), + ], + _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 a server. + + Delete a server. Volumes won't be deleted. + + :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._delete_server_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]] = { + "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_server_serialize( + self, + project_id, + server_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 server_id is not None: + _path_params["serverId"] = server_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="/v1beta1/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 delete_snapshot( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], + _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 a snapshot. + + Delete a snapshot that is part of the project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_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_snapshot_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."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], + _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 a snapshot. + + Delete a snapshot that is part of the project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_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_snapshot_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."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], + _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 a snapshot. + + Delete a snapshot that is part of the project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_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_snapshot_serialize( + self, + project_id, + snapshot_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 snapshot_id is not None: + _path_params["snapshotId"] = snapshot_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="/v1beta1/projects/{projectId}/snapshots/{snapshotId}", + 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_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."), + ], + _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 a volume. + + Delete a volume inside a project. The deletion will fail if the volume is still in use. + + :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 _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_volume_serialize( + project_id=project_id, + volume_id=volume_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", + "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 delete_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."), + ], + _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 a volume. + + Delete a volume inside a project. The deletion will fail if the volume is still in use. + + :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 _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_volume_serialize( + project_id=project_id, + volume_id=volume_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", + "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 delete_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."), + ], + _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 a volume. + + Delete a volume inside a project. The deletion will fail if the volume is still in use. + + :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 _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_volume_serialize( + project_id=project_id, + volume_id=volume_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", + "409": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_volume_serialize( + self, + project_id, + volume_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 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 + + # 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="/v1beta1/projects/{projectId}/volumes/{volumeId}", + 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_affinity_group( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + affinity_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity 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, + ) -> AffinityGroup: + """Get the affinity group. + + Get the affinity group created in a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) + :type affinity_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_affinity_group_serialize( + project_id=project_id, + affinity_group_id=affinity_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AffinityGroup", + "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_affinity_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."), + ], + affinity_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity 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, + ) -> ApiResponse[AffinityGroup]: + """Get the affinity group. + + Get the affinity group created in a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) + :type affinity_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_affinity_group_serialize( + project_id=project_id, + affinity_group_id=affinity_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AffinityGroup", + "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_affinity_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."), + ], + affinity_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity 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 the affinity group. + + Get the affinity group created in a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) + :type affinity_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_affinity_group_serialize( + project_id=project_id, + affinity_group_id=affinity_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AffinityGroup", + "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_affinity_group_serialize( + self, + project_id, + affinity_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 affinity_group_id is not None: + _path_params["affinityGroupId"] = affinity_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="/v1beta1/projects/{projectId}/affinity-groups/{affinityGroupId}", + 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_attached_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[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], + _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, + ) -> VolumeAttachment: + """Get Volume Attachment details. + + Get the details of an existing Volume Attachment. + + :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 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 + (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_attached_volume_serialize( + project_id=project_id, + server_id=server_id, + volume_id=volume_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumeAttachment", + "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_attached_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[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], + _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[VolumeAttachment]: + """Get Volume Attachment details. + + Get the details of an existing Volume Attachment. + + :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 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 + (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_attached_volume_serialize( + project_id=project_id, + server_id=server_id, + volume_id=volume_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumeAttachment", + "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_attached_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[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], + _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 Volume Attachment details. + + Get the details of an existing Volume Attachment. + + :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 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 + (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_attached_volume_serialize( + project_id=project_id, + server_id=server_id, + volume_id=volume_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumeAttachment", + "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_attached_volume_serialize( + self, + project_id, + server_id, + volume_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 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", + 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_backup( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + backup_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), + ], + _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, + ) -> Backup: + """Get details about a backup. + + Get details about a block device backup. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_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_backup_serialize( + project_id=project_id, + backup_id=backup_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Backup", + "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_backup_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."), + ], + backup_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), + ], + _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[Backup]: + """Get details about a backup. + + Get details about a block device backup. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_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_backup_serialize( + project_id=project_id, + backup_id=backup_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Backup", + "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_backup_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."), + ], + backup_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), + ], + _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 backup. + + Get details about a block device backup. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_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_backup_serialize( + project_id=project_id, + backup_id=backup_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Backup", + "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_backup_serialize( + self, + project_id, + backup_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 backup_id is not None: + _path_params["backupId"] = backup_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="/v1beta1/projects/{projectId}/backups/{backupId}", + 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_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.") + ], + _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: + """Get details about an image. + + Get details about a specific 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 _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_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]] = { + "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 get_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[Image]: + """Get details about an image. + + Get details about a specific 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 _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_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]] = { + "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 get_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: + """Get details about an image. + + Get details about a specific 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 _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_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]] = { + "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 _get_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="GET", + resource_path="/v1beta1/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 get_image_share( + 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, + ) -> ImageShare: + """Get share details of an image. + + Get share details about an shared image. + + :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._get_image_share_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]] = { + "200": "ImageShare", + "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_image_share_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[ImageShare]: + """Get share details of an image. + + Get share details about an shared image. + + :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._get_image_share_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]] = { + "200": "ImageShare", + "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_image_share_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: + """Get share details of an image. + + Get share details about an shared image. + + :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._get_image_share_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]] = { + "200": "ImageShare", + "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_image_share_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="GET", + resource_path="/v1beta1/projects/{projectId}/images/{imageId}/share", + 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_image_share_consumer( + 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.") + ], + consumer_project_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Project that consumes an image share.", + ), + ], + _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, + ) -> ImageShareConsumer: + """Get image share consumer. + + Get details about an image share consumer. + + :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 consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) + :type consumer_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 + (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_image_share_consumer_serialize( + project_id=project_id, + image_id=image_id, + consumer_project_id=consumer_project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ImageShareConsumer", + "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_image_share_consumer_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.") + ], + consumer_project_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Project that consumes an image share.", + ), + ], + _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[ImageShareConsumer]: + """Get image share consumer. + + Get details about an image share consumer. + + :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 consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) + :type consumer_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 + (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_image_share_consumer_serialize( + project_id=project_id, + image_id=image_id, + consumer_project_id=consumer_project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ImageShareConsumer", + "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_image_share_consumer_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.") + ], + consumer_project_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Project that consumes an image share.", + ), + ], + _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 image share consumer. + + Get details about an image share consumer. + + :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 consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) + :type consumer_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 + (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_image_share_consumer_serialize( + project_id=project_id, + image_id=image_id, + consumer_project_id=consumer_project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ImageShareConsumer", + "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_image_share_consumer_serialize( + self, + project_id, + image_id, + consumer_project_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 + if consumer_project_id is not None: + _path_params["consumerProjectId"] = consumer_project_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="/v1beta1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}", + 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_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, + ) -> Keypair: + """Get SSH keypair details. + + Get details about an SSH keypair. + + :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._get_key_pair_serialize( + keypair_name=keypair_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Keypair", + "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_key_pair_with_http_info( + 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, + ) -> ApiResponse[Keypair]: + """Get SSH keypair details. + + Get details about an SSH keypair. + + :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._get_key_pair_serialize( + keypair_name=keypair_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Keypair", + "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_key_pair_without_preload_content( + 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, + ) -> RESTResponseType: + """Get SSH keypair details. + + Get details about an SSH keypair. + + :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._get_key_pair_serialize( + keypair_name=keypair_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Keypair", + "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_key_pair_serialize( + self, + keypair_name, + _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 keypair_name is not None: + _path_params["keypairName"] = keypair_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/keypairs/{keypairName}", + 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_machine_type( + self, + project_id: Annotated[ + str, + 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)], + 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, + ) -> MachineType: + """Get details about a machine type. + + Get details about a specific machine type. + + :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 + (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_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MachineType", + "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_machine_type_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."), + ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], + _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[MachineType]: + """Get details about a machine type. + + Get details about a specific machine type. + + :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 + (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_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MachineType", + "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_machine_type_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."), + ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], + _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 machine type. + + Get details about a specific machine type. + + :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 + (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_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MachineType", + "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_machine_type_serialize( + self, + project_id, + machine_type, + _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 machine_type is not None: + _path_params["machineType"] = machine_type + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta1/projects/{projectId}/machine-types/{machineType}", + 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_network( + 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."), + ], + _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, + ) -> Network: + """Get network details. + + 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 _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_network_serialize( + project_id=project_id, + network_id=network_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Network", + "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_network_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."), + ], + _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[Network]: + """Get network details. + + 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 _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_network_serialize( + project_id=project_id, + network_id=network_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Network", + "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_network_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."), + ], + _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 network details. + + 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 _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_network_serialize( + project_id=project_id, + network_id=network_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Network", + "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_network_serialize( + self, + project_id, + network_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 network_id is not None: + _path_params["networkId"] = network_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="/v1beta1/projects/{projectId}/networks/{networkId}", + 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_network_area( + 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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + _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, + ) -> NetworkArea: + """Get details about a network area. + + 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 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 + (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_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkArea", + "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_network_area_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + _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[NetworkArea]: + """Get details about a network area. + + 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 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 + (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_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkArea", + "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_network_area_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + _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 network area. + + 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 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 + (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_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkArea", + "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_network_area_serialize( + self, + organization_id, + area_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 organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_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="/v1beta1/organizations/{organizationId}/network-areas/{areaId}", + 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_network_area_range( + 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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + network_range_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), + ], + _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, + ) -> NetworkRange: + """Get details about a network range. + + Get details about a network range in a network area. + + :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_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_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkRange", + "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_network_area_range_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + network_range_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), + ], + _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[NetworkRange]: + """Get details about a network range. + + Get details about a network range in a network area. + + :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_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_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkRange", + "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_network_area_range_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + network_range_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." + ), + ], + _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 network range. + + Get details about a network range in a network area. + + :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) + :type network_range_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_network_area_range_serialize( + organization_id=organization_id, + area_id=area_id, + network_range_id=network_range_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkRange", + "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_network_area_range_serialize( + self, + organization_id, + area_id, + network_range_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 organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if network_range_id is not None: + _path_params["networkRangeId"] = network_range_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="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", + 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_network_area_route( + 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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + _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, + ) -> Route: + """Get details about a network route. + + Get details about a network route defined in a network area. + + :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 route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_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_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Route", + "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_network_area_route_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + _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[Route]: + """Get details about a network route. + + Get details about a network route defined in a network area. + + :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 route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_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_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Route", + "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_network_area_route_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[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + _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 network route. + + Get details about a network route defined in a network area. + + :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 route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_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_network_area_route_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Route", + "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_network_area_route_serialize( + self, + organization_id, + area_id, + route_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 organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if route_id is not None: + _path_params["routeId"] = route_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="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", + 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_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)], + 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, + ) -> NIC: + """Get details about a network interface. + + 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 + (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_nic_serialize( + project_id=project_id, + network_id=network_id, + nic_id=nic_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NIC", + "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_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)], + 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[NIC]: + """Get details about a network interface. + + 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 @@ -6066,9 +14957,10 @@ def delete_network_area_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _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, @@ -6076,12 +14968,11 @@ def delete_network_area_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "NIC", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6092,19 +14983,19 @@ def delete_network_area_with_http_info( ) @validate_call - def delete_network_area_without_preload_content( + def get_nic_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + network_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 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, @@ -6116,14 +15007,16 @@ def delete_network_area_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a network area. + """Get details about a network interface. - Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + Get details about a network interface inside a network. - :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 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 @@ -6146,9 +15039,10 @@ def delete_network_area_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_serialize( - organization_id=organization_id, - area_id=area_id, + _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, @@ -6156,21 +15050,21 @@ def delete_network_area_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "NIC", "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 _delete_network_area_serialize( + def _get_nic_serialize( self, - organization_id, - area_id, + project_id, + network_id, + nic_id, _request_auth, _content_type, _headers, @@ -6189,10 +15083,12 @@ def _delete_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 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 @@ -6206,8 +15102,8 @@ def _delete_network_area_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}", + method="GET", + resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6221,7 +15117,7 @@ def _delete_network_area_serialize( ) @validate_call - def delete_network_area_range( + def get_organization_request( self, organization_id: Annotated[ str, @@ -6229,17 +15125,9 @@ def delete_network_area_range( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - network_range_id: Annotated[ + request_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -6250,17 +15138,15 @@ def delete_network_area_range( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a network range. + ) -> Request: + """Lookup an organization request ID. - Delete a network range of a network area. The deletion will fail if the network range is still used. + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_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 @@ -6283,10 +15169,9 @@ def delete_network_area_range( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_range_serialize( + _param = self._get_organization_request_serialize( organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6294,12 +15179,11 @@ def delete_network_area_range( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Request", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6310,7 +15194,7 @@ def delete_network_area_range( ).data @validate_call - def delete_network_area_range_with_http_info( + def get_organization_request_with_http_info( self, organization_id: Annotated[ str, @@ -6318,17 +15202,9 @@ def delete_network_area_range_with_http_info( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - network_range_id: Annotated[ + request_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -6339,17 +15215,15 @@ def delete_network_area_range_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[None]: - """Delete a network range. + ) -> ApiResponse[Request]: + """Lookup an organization request ID. - Delete a network range of a network area. The deletion will fail if the network range is still used. + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_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 @@ -6372,10 +15246,9 @@ def delete_network_area_range_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_range_serialize( + _param = self._get_organization_request_serialize( organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6383,12 +15256,11 @@ def delete_network_area_range_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Request", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6399,7 +15271,7 @@ def delete_network_area_range_with_http_info( ) @validate_call - def delete_network_area_range_without_preload_content( + def get_organization_request_without_preload_content( self, organization_id: Annotated[ str, @@ -6407,17 +15279,9 @@ def delete_network_area_range_without_preload_content( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - network_range_id: Annotated[ + request_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -6429,16 +15293,14 @@ def delete_network_area_range_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a network range. + """Lookup an organization request ID. - Delete a network range of a network area. The deletion will fail if the network range is still used. + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_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 @@ -6461,10 +15323,9 @@ def delete_network_area_range_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_range_serialize( + _param = self._get_organization_request_serialize( organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6472,22 +15333,20 @@ def delete_network_area_range_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Request", "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 _delete_network_area_range_serialize( + def _get_organization_request_serialize( self, organization_id, - area_id, - network_range_id, + request_id, _request_auth, _content_type, _headers, @@ -6508,10 +15367,8 @@ def _delete_network_area_range_serialize( # 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 network_range_id is not None: - _path_params["networkRangeId"] = network_range_id + if request_id is not None: + _path_params["requestId"] = request_id # process the query parameters # process the header parameters # process the form parameters @@ -6525,8 +15382,8 @@ def _delete_network_area_range_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", + method="GET", + resource_path="/v1beta1/organizations/{organizationId}/requests/{requestId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6540,22 +15397,15 @@ def _delete_network_area_range_serialize( ) @validate_call - def delete_network_area_route( + def get_project_nic( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + nic_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], _request_timeout: Union[ None, @@ -6566,17 +15416,15 @@ def delete_network_area_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a network route. + ) -> NIC: + """Get details about a network interface of a project. - Delete a network route of a network area. + Get details about a network interface inside a project. - :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 route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_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 @@ -6599,10 +15447,9 @@ def delete_network_area_route( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, + _param = self._get_project_nic_serialize( + project_id=project_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6610,7 +15457,7 @@ def delete_network_area_route( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "NIC", "400": "Error", "401": "Error", "403": "Error", @@ -6625,22 +15472,15 @@ def delete_network_area_route( ).data @validate_call - def delete_network_area_route_with_http_info( + def get_project_nic_with_http_info( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + nic_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], _request_timeout: Union[ None, @@ -6651,17 +15491,15 @@ def delete_network_area_route_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[None]: - """Delete a network route. - - Delete a network route of a network area. - - :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 route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str + ) -> ApiResponse[NIC]: + """Get details about a network interface of a project. + + Get details about a network interface inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_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 @@ -6684,10 +15522,9 @@ def delete_network_area_route_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, + _param = self._get_project_nic_serialize( + project_id=project_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6695,7 +15532,7 @@ def delete_network_area_route_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "NIC", "400": "Error", "401": "Error", "403": "Error", @@ -6710,22 +15547,15 @@ def delete_network_area_route_with_http_info( ) @validate_call - def delete_network_area_route_without_preload_content( + def get_project_nic_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + nic_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), ], _request_timeout: Union[ None, @@ -6737,16 +15567,14 @@ def delete_network_area_route_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a network route. + """Get details about a network interface of a project. - Delete a network route of a network area. + Get details about a network interface inside a project. - :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 route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_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 @@ -6769,10 +15597,9 @@ def delete_network_area_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, + _param = self._get_project_nic_serialize( + project_id=project_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6780,7 +15607,7 @@ def delete_network_area_route_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "NIC", "400": "Error", "401": "Error", "403": "Error", @@ -6790,11 +15617,10 @@ def delete_network_area_route_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_network_area_route_serialize( + def _get_project_nic_serialize( self, - organization_id, - area_id, - route_id, + project_id, + nic_id, _request_auth, _content_type, _headers, @@ -6813,12 +15639,10 @@ def _delete_network_area_route_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 route_id is not None: - _path_params["routeId"] = route_id + if project_id is not None: + _path_params["projectId"] = project_id + if nic_id is not None: + _path_params["nicId"] = nic_id # process the query parameters # process the header parameters # process the form parameters @@ -6832,8 +15656,8 @@ def _delete_network_area_route_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", + method="GET", + resource_path="/v1beta1/projects/{projectId}/nics/{nicId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6847,19 +15671,15 @@ def _delete_network_area_route_serialize( ) @validate_call - def delete_nic( + 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."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - nic_id: Annotated[ + request_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -6870,17 +15690,15 @@ def delete_nic( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a network interface. + ) -> Request: + """Lookup a project request ID. - Delete a network interface that is part of the 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 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_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 @@ -6903,10 +15721,9 @@ def delete_nic( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_nic_serialize( + _param = self._get_project_request_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6914,7 +15731,7 @@ def delete_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "Request", "400": "Error", "401": "Error", "403": "Error", @@ -6929,19 +15746,15 @@ def delete_nic( ).data @validate_call - def delete_nic_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."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - nic_id: Annotated[ + request_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -6952,17 +15765,15 @@ def delete_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[None]: - """Delete a network interface. + ) -> ApiResponse[Request]: + """Lookup a project request ID. - Delete a network interface that is part of the 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 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_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 @@ -6985,10 +15796,9 @@ def delete_nic_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_nic_serialize( + _param = self._get_project_request_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6996,7 +15806,7 @@ def delete_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "Request", "400": "Error", "401": "Error", "403": "Error", @@ -7011,19 +15821,15 @@ def delete_nic_with_http_info( ) @validate_call - def delete_nic_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."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - nic_id: Annotated[ + request_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), ], _request_timeout: Union[ None, @@ -7035,16 +15841,14 @@ def delete_nic_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a network interface. + """Lookup a project request ID. - Delete a network interface that is part of the 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 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_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 @@ -7067,10 +15871,9 @@ def delete_nic_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_nic_serialize( + _param = self._get_project_request_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + request_id=request_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7078,7 +15881,7 @@ def delete_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "Request", "400": "Error", "401": "Error", "403": "Error", @@ -7088,11 +15891,10 @@ def delete_nic_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_nic_serialize( + def _get_project_request_serialize( self, project_id, - network_id, - nic_id, + request_id, _request_auth, _content_type, _headers, @@ -7113,10 +15915,8 @@ def _delete_nic_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 + if request_id is not None: + _path_params["requestId"] = request_id # process the query parameters # process the header parameters # process the form parameters @@ -7130,8 +15930,8 @@ def _delete_nic_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + method="GET", + resource_path="/v1beta1/projects/{projectId}/requests/{requestId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7145,7 +15945,7 @@ def _delete_nic_serialize( ) @validate_call - def delete_public_ip( + def get_public_ip( self, project_id: Annotated[ str, @@ -7163,10 +15963,10 @@ def delete_public_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a public IP. + ) -> PublicIp: + """Get details about a public IP. - Delete a public IP that is part of the 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 @@ -7194,7 +15994,7 @@ def delete_public_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_public_ip_serialize( + _param = self._get_public_ip_serialize( project_id=project_id, public_ip_id=public_ip_id, _request_auth=_request_auth, @@ -7204,7 +16004,7 @@ def delete_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "PublicIp", "400": "Error", "401": "Error", "403": "Error", @@ -7219,7 +16019,7 @@ def delete_public_ip( ).data @validate_call - def delete_public_ip_with_http_info( + def get_public_ip_with_http_info( self, project_id: Annotated[ str, @@ -7237,10 +16037,10 @@ def delete_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[None]: - """Delete a public IP. + ) -> ApiResponse[PublicIp]: + """Get details about a public IP. - Delete a public IP that is part of the 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 @@ -7268,7 +16068,7 @@ def delete_public_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_public_ip_serialize( + _param = self._get_public_ip_serialize( project_id=project_id, public_ip_id=public_ip_id, _request_auth=_request_auth, @@ -7278,7 +16078,7 @@ def delete_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "PublicIp", "400": "Error", "401": "Error", "403": "Error", @@ -7293,7 +16093,7 @@ def delete_public_ip_with_http_info( ) @validate_call - def delete_public_ip_without_preload_content( + def get_public_ip_without_preload_content( self, project_id: Annotated[ str, @@ -7312,9 +16112,9 @@ def delete_public_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a public IP. + """Get details about a public IP. - Delete a public IP that is part of the 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 @@ -7342,7 +16142,7 @@ def delete_public_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_public_ip_serialize( + _param = self._get_public_ip_serialize( project_id=project_id, public_ip_id=public_ip_id, _request_auth=_request_auth, @@ -7352,7 +16152,7 @@ def delete_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "PublicIp", "400": "Error", "401": "Error", "403": "Error", @@ -7362,7 +16162,7 @@ def delete_public_ip_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_public_ip_serialize( + def _get_public_ip_serialize( self, project_id, public_ip_id, @@ -7401,7 +16201,7 @@ def _delete_public_ip_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", + method="GET", resource_path="/v1beta1/projects/{projectId}/public-ips/{publicIpId}", path_params=_path_params, query_params=_query_params, @@ -7416,7 +16216,7 @@ def _delete_public_ip_serialize( ) @validate_call - def delete_security_group( + def get_security_group( self, project_id: Annotated[ str, @@ -7440,10 +16240,10 @@ def delete_security_group( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete security group. + ) -> SecurityGroup: + """Get security group details. - Delete a security group. + Get details about a security group of a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -7471,7 +16271,7 @@ def delete_security_group( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_security_group_serialize( + _param = self._get_security_group_serialize( project_id=project_id, security_group_id=security_group_id, _request_auth=_request_auth, @@ -7481,12 +16281,11 @@ def delete_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "SecurityGroup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7497,7 +16296,7 @@ def delete_security_group( ).data @validate_call - def delete_security_group_with_http_info( + def get_security_group_with_http_info( self, project_id: Annotated[ str, @@ -7521,10 +16320,10 @@ def delete_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[None]: - """Delete security group. + ) -> ApiResponse[SecurityGroup]: + """Get security group details. - Delete a security group. + Get details about a security group of a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -7552,7 +16351,7 @@ def delete_security_group_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_security_group_serialize( + _param = self._get_security_group_serialize( project_id=project_id, security_group_id=security_group_id, _request_auth=_request_auth, @@ -7562,12 +16361,11 @@ def delete_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "SecurityGroup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7578,7 +16376,7 @@ def delete_security_group_with_http_info( ) @validate_call - def delete_security_group_without_preload_content( + def get_security_group_without_preload_content( self, project_id: Annotated[ str, @@ -7603,9 +16401,9 @@ def delete_security_group_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete security group. + """Get security group details. - Delete a security group. + Get details about a security group of a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -7633,7 +16431,7 @@ def delete_security_group_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_security_group_serialize( + _param = self._get_security_group_serialize( project_id=project_id, security_group_id=security_group_id, _request_auth=_request_auth, @@ -7643,18 +16441,17 @@ def delete_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "SecurityGroup", "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 _delete_security_group_serialize( + def _get_security_group_serialize( self, project_id, security_group_id, @@ -7693,7 +16490,7 @@ def _delete_security_group_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", + method="GET", resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}", path_params=_path_params, query_params=_query_params, @@ -7708,7 +16505,7 @@ def _delete_security_group_serialize( ) @validate_call - def delete_security_group_rule( + def get_security_group_rule( self, project_id: Annotated[ str, @@ -7741,10 +16538,10 @@ def delete_security_group_rule( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete security group rule. + ) -> SecurityGroupRule: + """Get security group rule details. - Delete a security group rule. + 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 @@ -7774,7 +16571,7 @@ def delete_security_group_rule( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_security_group_rule_serialize( + _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, @@ -7785,7 +16582,7 @@ def delete_security_group_rule( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "SecurityGroupRule", "400": "Error", "401": "Error", "403": "Error", @@ -7800,7 +16597,7 @@ def delete_security_group_rule( ).data @validate_call - def delete_security_group_rule_with_http_info( + def get_security_group_rule_with_http_info( self, project_id: Annotated[ str, @@ -7833,10 +16630,10 @@ def delete_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[None]: - """Delete security group rule. + ) -> ApiResponse[SecurityGroupRule]: + """Get security group rule details. - Delete a security group rule. + 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 @@ -7866,7 +16663,7 @@ def delete_security_group_rule_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_security_group_rule_serialize( + _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, @@ -7877,7 +16674,7 @@ def delete_security_group_rule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "SecurityGroupRule", "400": "Error", "401": "Error", "403": "Error", @@ -7892,7 +16689,7 @@ def delete_security_group_rule_with_http_info( ) @validate_call - def delete_security_group_rule_without_preload_content( + def get_security_group_rule_without_preload_content( self, project_id: Annotated[ str, @@ -7926,9 +16723,9 @@ def delete_security_group_rule_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete security group rule. + """Get security group rule details. - Delete a security group rule. + 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 @@ -7958,7 +16755,7 @@ def delete_security_group_rule_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_security_group_rule_serialize( + _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, @@ -7969,7 +16766,7 @@ def delete_security_group_rule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "SecurityGroupRule", "400": "Error", "401": "Error", "403": "Error", @@ -7979,7 +16776,7 @@ def delete_security_group_rule_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_security_group_rule_serialize( + def _get_security_group_rule_serialize( self, project_id, security_group_id, @@ -8021,7 +16818,7 @@ def _delete_security_group_rule_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", + method="GET", resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", path_params=_path_params, query_params=_query_params, @@ -8036,7 +16833,7 @@ def _delete_security_group_rule_serialize( ) @validate_call - def delete_server( + def get_server( self, project_id: Annotated[ str, @@ -8046,6 +16843,7 @@ def delete_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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8055,15 +16853,17 @@ def delete_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a server. + ) -> Server: + """Get server details. - Delete a server. Volumes won't be deleted. + 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 @@ -8086,9 +16886,10 @@ def delete_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_server_serialize( + _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, @@ -8096,7 +16897,7 @@ def delete_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -8111,7 +16912,7 @@ def delete_server( ).data @validate_call - def delete_server_with_http_info( + def get_server_with_http_info( self, project_id: Annotated[ str, @@ -8121,6 +16922,7 @@ def delete_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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8130,15 +16932,17 @@ def delete_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[None]: - """Delete a server. + ) -> ApiResponse[Server]: + """Get server details. - Delete a server. Volumes won't be deleted. + 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 @@ -8161,9 +16965,10 @@ def delete_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_server_serialize( + _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, @@ -8171,7 +16976,7 @@ def delete_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -8186,7 +16991,7 @@ def delete_server_with_http_info( ) @validate_call - def delete_server_without_preload_content( + def get_server_without_preload_content( self, project_id: Annotated[ str, @@ -8196,6 +17001,7 @@ def delete_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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8206,14 +17012,16 @@ def delete_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a server. + """Get server details. - Delete a server. Volumes won't be deleted. + 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 @@ -8236,9 +17044,10 @@ def delete_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_server_serialize( + _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, @@ -8246,7 +17055,7 @@ def delete_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -8256,10 +17065,11 @@ def delete_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_server_serialize( + def _get_server_serialize( self, project_id, server_id, + details, _request_auth, _content_type, _headers, @@ -8283,6 +17093,10 @@ def _delete_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 @@ -8295,7 +17109,7 @@ def _delete_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", + method="GET", resource_path="/v1beta1/projects/{projectId}/servers/{serverId}", path_params=_path_params, query_params=_query_params, @@ -8310,15 +17124,15 @@ def _delete_server_serialize( ) @validate_call - def delete_volume( + 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."), ], - 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, @@ -8329,15 +17143,15 @@ def delete_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a volume. + ) -> ServerConsoleUrl: + """Get server console. - Delete a volume inside a project. The deletion will fail if the volume is still in use. + Get a URL for server remote console. :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 @@ -8360,9 +17174,9 @@ def delete_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_volume_serialize( + _param = self._get_server_console_serialize( project_id=project_id, - volume_id=volume_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8370,12 +17184,11 @@ def delete_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ServerConsoleUrl", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8386,15 +17199,15 @@ def delete_volume( ).data @validate_call - def delete_volume_with_http_info( + 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."), ], - 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, @@ -8405,15 +17218,15 @@ def delete_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[None]: - """Delete a volume. + ) -> ApiResponse[ServerConsoleUrl]: + """Get server console. - Delete a volume inside a project. The deletion will fail if the volume is still in use. + Get a URL for server remote console. :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 @@ -8436,9 +17249,9 @@ def delete_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_volume_serialize( + _param = self._get_server_console_serialize( project_id=project_id, - volume_id=volume_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8446,12 +17259,11 @@ def delete_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ServerConsoleUrl", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8462,15 +17274,15 @@ def delete_volume_with_http_info( ) @validate_call - def delete_volume_without_preload_content( + 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."), ], - 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, @@ -8482,14 +17294,14 @@ def delete_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a volume. + """Get server console. - Delete a volume inside a project. The deletion will fail if the volume is still in use. + Get a URL for server remote console. :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 @@ -8512,9 +17324,9 @@ def delete_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_volume_serialize( + _param = self._get_server_console_serialize( project_id=project_id, - volume_id=volume_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8522,21 +17334,20 @@ def delete_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ServerConsoleUrl", "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 _delete_volume_serialize( + def _get_server_console_serialize( self, project_id, - volume_id, + server_id, _request_auth, _content_type, _headers, @@ -8557,8 +17368,8 @@ def _delete_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 @@ -8572,8 +17383,8 @@ def _delete_volume_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta1/projects/{projectId}/volumes/{volumeId}", + method="GET", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/console", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8587,7 +17398,7 @@ def _delete_volume_serialize( ) @validate_call - def get_attached_volume( + def get_server_log( self, project_id: Annotated[ str, @@ -8597,10 +17408,12 @@ def get_attached_volume( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], + length: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8610,17 +17423,17 @@ def get_attached_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeAttachment: - """Get Volume Attachment details. + ) -> GetServerLog200Response: + """Get server log. - Get the details of an existing Volume Attachment. + 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str + :param length: Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. + :type length: int :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 @@ -8643,10 +17456,10 @@ def get_attached_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_attached_volume_serialize( + _param = self._get_server_log_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, + length=length, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8654,7 +17467,7 @@ def get_attached_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -8669,7 +17482,7 @@ def get_attached_volume( ).data @validate_call - def get_attached_volume_with_http_info( + def get_server_log_with_http_info( self, project_id: Annotated[ str, @@ -8679,10 +17492,12 @@ def get_attached_volume_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], + length: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8692,17 +17507,17 @@ def get_attached_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[VolumeAttachment]: - """Get Volume Attachment details. + ) -> ApiResponse[GetServerLog200Response]: + """Get server log. - Get the details of an existing Volume Attachment. + 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str + :param length: Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. + :type length: int :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,10 +17540,10 @@ def get_attached_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_attached_volume_serialize( + _param = self._get_server_log_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, + length=length, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8736,7 +17551,7 @@ def get_attached_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -8751,7 +17566,7 @@ def get_attached_volume_with_http_info( ) @validate_call - def get_attached_volume_without_preload_content( + def get_server_log_without_preload_content( self, project_id: Annotated[ str, @@ -8761,10 +17576,12 @@ def get_attached_volume_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], + length: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=0)]], + Field( + description="Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8775,16 +17592,16 @@ def get_attached_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Volume Attachment details. + """Get server log. - Get the details of an existing Volume Attachment. + 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str + :param length: Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. + :type length: int :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 @@ -8807,10 +17624,10 @@ def get_attached_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_attached_volume_serialize( + _param = self._get_server_log_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, + length=length, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8818,7 +17635,7 @@ def get_attached_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "GetServerLog200Response", "400": "Error", "401": "Error", "403": "Error", @@ -8828,11 +17645,11 @@ def get_attached_volume_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_attached_volume_serialize( + def _get_server_log_serialize( self, project_id, server_id, - volume_id, + length, _request_auth, _content_type, _headers, @@ -8855,9 +17672,11 @@ def _get_attached_volume_serialize( _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 + if length is not None: + + _query_params.append(("length", length)) + # process the header parameters # process the form parameters # process the body parameter @@ -8871,7 +17690,7 @@ def _get_attached_volume_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/log", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8885,9 +17704,16 @@ def _get_attached_volume_serialize( ) @validate_call - def get_key_pair( + def get_snapshot( 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."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8897,13 +17723,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. + ) -> Snapshot: + """Get details about a snapshot. - Get details about an SSH keypair. + Get details about a block device snapshot. - :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 snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_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 @@ -8925,9 +17753,10 @@ def get_key_pair( :type _host_index: int, optional :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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8935,7 +17764,7 @@ def get_key_pair( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -8950,9 +17779,16 @@ def get_key_pair( ).data @validate_call - def get_key_pair_with_http_info( + def get_snapshot_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."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8962,13 +17798,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[Snapshot]: + """Get details about a snapshot. - Get details about an SSH keypair. + Get details about a block device snapshot. - :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 snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_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 @@ -8991,8 +17829,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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9000,7 +17839,7 @@ def get_key_pair_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -9015,9 +17854,16 @@ def get_key_pair_with_http_info( ) @validate_call - def get_key_pair_without_preload_content( + def get_snapshot_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."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9028,12 +17874,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 a snapshot. - Get details about an SSH keypair. + Get details about a block device snapshot. - :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 snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_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 @@ -9056,8 +17904,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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9065,7 +17914,7 @@ def get_key_pair_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -9075,9 +17924,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_snapshot_serialize( self, - keypair_name, + project_id, + snapshot_id, _request_auth, _content_type, _headers, @@ -9096,8 +17946,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 snapshot_id is not None: + _path_params["snapshotId"] = snapshot_id # process the query parameters # process the header parameters # process the form parameters @@ -9112,7 +17964,7 @@ def _get_key_pair_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/keypairs/{keypairName}", + resource_path="/v1beta1/projects/{projectId}/snapshots/{snapshotId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9126,13 +17978,16 @@ def _get_key_pair_serialize( ) @validate_call - def get_machine_type( + 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."), ], - machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9142,15 +17997,15 @@ def get_machine_type( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> MachineType: - """Get details about a machine type. + ) -> Volume: + """Get details about a volume. - Get details about a specific machine type. + Get details about a block device volume. :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 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 @@ -9173,9 +18028,9 @@ def get_machine_type( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_machine_type_serialize( + _param = self._get_volume_serialize( project_id=project_id, - machine_type=machine_type, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9183,7 +18038,7 @@ def get_machine_type( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -9198,13 +18053,16 @@ def get_machine_type( ).data @validate_call - def get_machine_type_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."), ], - machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9214,15 +18072,15 @@ def get_machine_type_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[MachineType]: - """Get details about a machine type. + ) -> ApiResponse[Volume]: + """Get details about a volume. - Get details about a specific machine type. + Get details about a block device volume. :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 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 @@ -9245,9 +18103,9 @@ def get_machine_type_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_machine_type_serialize( + _param = self._get_volume_serialize( project_id=project_id, - machine_type=machine_type, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9255,7 +18113,7 @@ def get_machine_type_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -9270,13 +18128,16 @@ def get_machine_type_with_http_info( ) @validate_call - def get_machine_type_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."), ], - machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9287,14 +18148,14 @@ def get_machine_type_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a machine type. + """Get details about a volume. - Get details about a specific machine type. + Get details about a block device volume. :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 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 @@ -9317,9 +18178,9 @@ def get_machine_type_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_machine_type_serialize( + _param = self._get_volume_serialize( project_id=project_id, - machine_type=machine_type, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9327,7 +18188,7 @@ def get_machine_type_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -9337,10 +18198,10 @@ def get_machine_type_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_machine_type_serialize( + def _get_volume_serialize( self, project_id, - machine_type, + volume_id, _request_auth, _content_type, _headers, @@ -9361,8 +18222,8 @@ def _get_machine_type_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if machine_type is not None: - _path_params["machineType"] = machine_type + if volume_id is not None: + _path_params["volumeId"] = volume_id # process the query parameters # process the header parameters # process the form parameters @@ -9377,7 +18238,7 @@ def _get_machine_type_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/machine-types/{machineType}", + resource_path="/v1beta1/projects/{projectId}/volumes/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9391,15 +18252,14 @@ def _get_machine_type_serialize( ) @validate_call - def get_network( + 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."), + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], _request_timeout: Union[ None, @@ -9410,15 +18270,15 @@ 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. + ) -> VolumePerformanceClass: + """Get details about a volume performance class. - Get details about a network of 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 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 @@ -9441,9 +18301,9 @@ def get_network( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - network_id=network_id, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9451,7 +18311,7 @@ def get_network( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -9466,15 +18326,14 @@ def get_network( ).data @validate_call - def get_network_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."), + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], _request_timeout: Union[ None, @@ -9485,15 +18344,15 @@ 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[VolumePerformanceClass]: + """Get details about a volume performance class. - Get details about a network of 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 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 @@ -9516,9 +18375,9 @@ def get_network_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - network_id=network_id, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9526,7 +18385,7 @@ def get_network_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -9541,15 +18400,14 @@ def get_network_with_http_info( ) @validate_call - def get_network_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."), + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") ], _request_timeout: Union[ None, @@ -9561,14 +18419,14 @@ 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 details about a volume performance class. - Get details about a network of 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 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 @@ -9591,9 +18449,9 @@ def get_network_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( + _param = self._get_volume_performance_class_serialize( project_id=project_id, - network_id=network_id, + volume_performance_class=volume_performance_class, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9601,7 +18459,7 @@ def get_network_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "200": "VolumePerformanceClass", "400": "Error", "401": "Error", "403": "Error", @@ -9611,10 +18469,10 @@ 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_volume_performance_class_serialize( self, project_id, - network_id, + volume_performance_class, _request_auth, _content_type, _headers, @@ -9635,8 +18493,8 @@ def _get_network_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 volume_performance_class is not None: + _path_params["volumePerformanceClass"] = volume_performance_class # process the query parameters # process the header parameters # process the form parameters @@ -9651,7 +18509,7 @@ def _get_network_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}", + resource_path="/v1beta1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9665,19 +18523,11 @@ def _get_network_serialize( ) @validate_call - def get_network_area( + def list_affinity_groups( 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."), ], _request_timeout: Union[ None, @@ -9688,15 +18538,13 @@ 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. + ) -> AffinityGroupListResponse: + """Get the affinity groups setup for a project. - Get details about a network area in an organization. + Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). - :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 _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 @@ -9719,9 +18567,8 @@ 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._list_affinity_groups_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9729,11 +18576,12 @@ def get_network_area( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "AffinityGroupListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9744,19 +18592,11 @@ def get_network_area( ).data @validate_call - def get_network_area_with_http_info( + def list_affinity_groups_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."), ], _request_timeout: Union[ None, @@ -9767,15 +18607,13 @@ 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[AffinityGroupListResponse]: + """Get the affinity groups setup for a project. - Get details about a network area in an organization. + Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). - :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 _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 @@ -9797,10 +18635,9 @@ def get_network_area_with_http_info( :type _host_index: int, optional :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._list_affinity_groups_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9808,11 +18645,12 @@ def get_network_area_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "AffinityGroupListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9823,19 +18661,11 @@ def get_network_area_with_http_info( ) @validate_call - def get_network_area_without_preload_content( + def list_affinity_groups_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."), ], _request_timeout: Union[ None, @@ -9847,14 +18677,12 @@ 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 the affinity groups setup for a project. - Get details about a network area in an organization. + Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). - :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 _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 @@ -9877,9 +18705,8 @@ 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._list_affinity_groups_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9887,20 +18714,20 @@ def get_network_area_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "200": "AffinityGroupListResponse", "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 _get_network_area_serialize( + def _list_affinity_groups_serialize( self, - organization_id, - area_id, + project_id, _request_auth, _content_type, _headers, @@ -9919,10 +18746,8 @@ 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 # process the query parameters # process the header parameters # process the form parameters @@ -9937,7 +18762,7 @@ def _get_network_area_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}", + resource_path="/v1beta1/projects/{projectId}/affinity-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9951,25 +18776,15 @@ def _get_network_area_serialize( ) @validate_call - def get_network_area_range( + def list_attached_volumes( 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."), ], - network_range_id: Annotated[ + server_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -9980,17 +18795,15 @@ def get_network_area_range( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkRange: - """Get details about a network range. + ) -> VolumeAttachmentListResponse: + """List all volume attachments of a server. - Get details about a network range in a network area. + Get a list of all volume attachments of a server. - :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str + :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 @@ -10013,10 +18826,9 @@ def get_network_area_range( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + _param = self._list_attached_volumes_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10024,7 +18836,7 @@ def get_network_area_range( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRange", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10039,25 +18851,15 @@ def get_network_area_range( ).data @validate_call - def get_network_area_range_with_http_info( + def list_attached_volumes_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."), ], - network_range_id: Annotated[ + server_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -10068,17 +18870,15 @@ def get_network_area_range_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[NetworkRange]: - """Get details about a network range. + ) -> ApiResponse[VolumeAttachmentListResponse]: + """List all volume attachments of a server. - Get details about a network range in a network area. + Get a list of all volume attachments of a server. - :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str + :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 @@ -10101,10 +18901,9 @@ def get_network_area_range_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + _param = self._list_attached_volumes_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10112,7 +18911,7 @@ def get_network_area_range_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRange", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10127,25 +18926,15 @@ def get_network_area_range_with_http_info( ) @validate_call - def get_network_area_range_without_preload_content( + def list_attached_volumes_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."), ], - network_range_id: Annotated[ + server_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -10157,16 +18946,14 @@ def get_network_area_range_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 range. + """List all volume attachments of a server. - Get details about a network range in a network area. + Get a list of all volume attachments of a server. - :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 network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str + :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 @@ -10189,10 +18976,9 @@ def get_network_area_range_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, + _param = self._list_attached_volumes_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10200,7 +18986,7 @@ def get_network_area_range_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRange", + "200": "VolumeAttachmentListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10210,11 +18996,10 @@ def get_network_area_range_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_network_area_range_serialize( + def _list_attached_volumes_serialize( self, - organization_id, - area_id, - network_range_id, + project_id, + server_id, _request_auth, _content_type, _headers, @@ -10233,12 +19018,10 @@ def _get_network_area_range_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 network_range_id is not None: - _path_params["networkRangeId"] = network_range_id + 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 # process the header parameters # process the form parameters @@ -10253,7 +19036,7 @@ def _get_network_area_range_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10267,23 +19050,8 @@ def _get_network_area_range_serialize( ) @validate_call - def get_network_area_route( + def list_availability_zones( 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[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10293,17 +19061,11 @@ def get_network_area_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Route: - """Get details about a network route. + ) -> AvailabilityZoneListResponse: + """List all availability zones. - Get details about a network route defined in a network area. + Get a list of all availability zones. - :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 route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_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 @@ -10326,18 +19088,12 @@ def get_network_area_route( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _param = self._list_availability_zones_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "AvailabilityZoneListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10352,23 +19108,8 @@ def get_network_area_route( ).data @validate_call - def get_network_area_route_with_http_info( + def list_availability_zones_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[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10377,18 +19118,12 @@ def get_network_area_route_with_http_info( _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[Route]: - """Get details about a network route. - - Get details about a network route defined in a network area. - - :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 route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AvailabilityZoneListResponse]: + """List all availability zones. + + Get a list of all availability zones. + :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 @@ -10411,18 +19146,12 @@ def get_network_area_route_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _param = self._list_availability_zones_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "AvailabilityZoneListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10437,23 +19166,8 @@ def get_network_area_route_with_http_info( ) @validate_call - def get_network_area_route_without_preload_content( + def list_availability_zones_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[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10464,16 +19178,10 @@ def get_network_area_route_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 route. + """List all availability zones. - Get details about a network route defined in a network area. + Get a list of all availability zones. - :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 route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_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 @@ -10496,18 +19204,12 @@ def get_network_area_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _param = self._list_availability_zones_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "AvailabilityZoneListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10517,11 +19219,8 @@ def get_network_area_route_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_network_area_route_serialize( + def _list_availability_zones_serialize( self, - organization_id, - area_id, - route_id, _request_auth, _content_type, _headers, @@ -10540,12 +19239,6 @@ def _get_network_area_route_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 route_id is not None: - _path_params["routeId"] = route_id # process the query parameters # process the header parameters # process the form parameters @@ -10560,7 +19253,7 @@ def _get_network_area_route_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", + resource_path="/v1beta1/availability-zones", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10574,20 +19267,13 @@ def _get_network_area_route_serialize( ) @validate_call - def get_nic( + def list_backups( 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."), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10597,17 +19283,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. + ) -> BackupListResponse: + """List all backups inside a project. - Get details about a network interface inside a network. + Get a list of all backups inside 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 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 @@ -10630,10 +19314,9 @@ def get_nic( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_nic_serialize( + _param = self._list_backups_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10641,7 +19324,7 @@ def get_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "BackupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10656,20 +19339,13 @@ def get_nic( ).data @validate_call - def get_nic_with_http_info( + def list_backups_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."), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10679,17 +19355,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[BackupListResponse]: + """List all backups inside a project. - Get details about a network interface inside a network. + Get a list of all backups inside 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 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 @@ -10712,10 +19386,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._list_backups_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10723,7 +19396,7 @@ def get_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "BackupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10738,20 +19411,13 @@ def get_nic_with_http_info( ) @validate_call - def get_nic_without_preload_content( + def list_backups_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."), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10762,16 +19428,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. + """List all backups inside a project. - Get details about a network interface inside a network. + Get a list of all backups inside 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 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 @@ -10794,10 +19458,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._list_backups_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10805,7 +19468,7 @@ def get_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "200": "BackupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10815,11 +19478,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 _list_backups_serialize( self, project_id, - network_id, - nic_id, + label_selector, _request_auth, _content_type, _headers, @@ -10840,11 +19502,11 @@ def _get_nic_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 + 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 @@ -10858,7 +19520,7 @@ def _get_nic_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + resource_path="/v1beta1/projects/{projectId}/backups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10872,18 +19534,13 @@ def _get_nic_serialize( ) @validate_call - def get_organization_request( + def list_images( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - request_id: Annotated[ + project_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 Project."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10893,15 +19550,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. + ) -> ImageListResponse: + """List all Images inside a project. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get a list of all images inside a project. - :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 project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_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 @@ -10924,9 +19581,9 @@ def get_organization_request( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( - organization_id=organization_id, - request_id=request_id, + _param = self._list_images_serialize( + project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10934,7 +19591,7 @@ def get_organization_request( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "ImageListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -10949,18 +19606,13 @@ def get_organization_request( ).data @validate_call - def get_organization_request_with_http_info( + def list_images_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." - ), - ], - request_id: Annotated[ + project_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 Project."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10970,15 +19622,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[ImageListResponse]: + """List all Images inside a project. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get a list of all images inside a project. - :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 project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_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 @@ -11001,9 +19653,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( - organization_id=organization_id, - request_id=request_id, + _param = self._list_images_serialize( + project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11011,7 +19663,7 @@ def get_organization_request_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "ImageListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11026,18 +19678,13 @@ def get_organization_request_with_http_info( ) @validate_call - def get_organization_request_without_preload_content( + def list_images_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." - ), - ], - request_id: Annotated[ + project_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 Project."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11048,14 +19695,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. + """List all Images inside a project. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Get a list of all images inside a project. - :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 project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_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 @@ -11078,9 +19725,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( - organization_id=organization_id, - request_id=request_id, + _param = self._list_images_serialize( + project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11088,7 +19735,7 @@ def get_organization_request_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "ImageListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11098,10 +19745,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 _list_images_serialize( self, - organization_id, - request_id, + project_id, + label_selector, _request_auth, _content_type, _headers, @@ -11120,11 +19767,13 @@ def _get_organization_request_serialize( _body_params: Optional[bytes] = None # 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 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 @@ -11138,7 +19787,7 @@ def _get_organization_request_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/requests/{requestId}", + resource_path="/v1beta1/projects/{projectId}/images", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11148,20 +19797,13 @@ def _get_organization_request_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - 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."), - ], - request_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), - ], + _request_auth=_request_auth, + ) + + @validate_call + def list_key_pairs( + self, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11171,15 +19813,13 @@ def get_project_request( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Request: - """Lookup a project request ID. + ) -> KeyPairListResponse: + """List all SSH keypairs for the requesting user. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + 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 request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_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 @@ -11202,9 +19842,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, - request_id=request_id, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11212,7 +19851,7 @@ def get_project_request( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11227,16 +19866,9 @@ def get_project_request( ).data @validate_call - def get_project_request_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."), - ], - request_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11246,15 +19878,13 @@ def get_project_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 a project request ID. + ) -> ApiResponse[KeyPairListResponse]: + """List all SSH keypairs for the requesting user. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + 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 request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_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 @@ -11277,9 +19907,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, - request_id=request_id, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11287,7 +19916,7 @@ def get_project_request_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11302,16 +19931,9 @@ def get_project_request_with_http_info( ) @validate_call - def get_project_request_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."), - ], - request_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), - ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11322,14 +19944,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. + """List all SSH keypairs for the requesting user. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + 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 request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_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 @@ -11352,9 +19972,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, - request_id=request_id, + _param = self._list_key_pairs_serialize( + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11362,7 +19981,7 @@ def get_project_request_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "200": "KeyPairListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11372,10 +19991,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 _list_key_pairs_serialize( self, - project_id, - request_id, + label_selector, _request_auth, _content_type, _headers, @@ -11394,11 +20012,11 @@ 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 request_id is not None: - _path_params["requestId"] = request_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 @@ -11412,7 +20030,7 @@ def _get_project_request_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/requests/{requestId}", + resource_path="/v1beta1/keypairs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11426,15 +20044,12 @@ def _get_project_request_serialize( ) @validate_call - def get_public_ip( + def list_machine_types( 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)], @@ -11444,15 +20059,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. + ) -> MachineTypeListResponse: + """List all machine types available for a project. - Get details about a public IP inside a project. + Get a list of all machine type available in 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 @@ -11475,9 +20088,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._list_machine_types_serialize( project_id=project_id, - public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11485,7 +20097,7 @@ def get_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11500,15 +20112,12 @@ def get_public_ip( ).data @validate_call - def get_public_ip_with_http_info( + def list_machine_types_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)], @@ -11518,15 +20127,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[MachineTypeListResponse]: + """List all machine types available for a project. - Get details about a public IP inside a project. + Get a list of all machine type available in 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 @@ -11549,9 +20156,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._list_machine_types_serialize( project_id=project_id, - public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11559,7 +20165,7 @@ def get_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11574,15 +20180,12 @@ def get_public_ip_with_http_info( ) @validate_call - def get_public_ip_without_preload_content( + def list_machine_types_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)], @@ -11593,14 +20196,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. + """List all machine types available for a project. - Get details about a public IP inside a project. + Get a list of all machine type available in 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 @@ -11623,9 +20224,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._list_machine_types_serialize( project_id=project_id, - public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11633,7 +20233,7 @@ def get_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "MachineTypeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11643,10 +20243,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 _list_machine_types_serialize( self, project_id, - public_ip_id, _request_auth, _content_type, _headers, @@ -11667,8 +20266,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 @@ -11683,7 +20280,7 @@ def _get_public_ip_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/public-ips/{publicIpId}", + resource_path="/v1beta1/projects/{projectId}/machine-types", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11697,19 +20294,18 @@ def _get_public_ip_serialize( ) @validate_call - def get_security_group( + def list_network_area_projects( 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." + ), ], - security_group_id: Annotated[ + area_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], _request_timeout: Union[ @@ -11721,15 +20317,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. + ) -> ProjectListResponse: + """List all projects using a network area. - Get details about a security group of a project. + Get a list of all projects using a network area. - :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 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 _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 @@ -11752,9 +20348,9 @@ def get_security_group( :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, + _param = self._list_network_area_projects_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11762,7 +20358,7 @@ def get_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "ProjectListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11777,19 +20373,18 @@ def get_security_group( ).data @validate_call - def get_security_group_with_http_info( + def list_network_area_projects_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." + ), ], - security_group_id: Annotated[ + area_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], _request_timeout: Union[ @@ -11801,15 +20396,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[ProjectListResponse]: + """List all projects using a network area. - Get details about a security group of a project. + Get a list of all projects using a network area. - :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 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 _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 @@ -11832,9 +20427,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( - project_id=project_id, - security_group_id=security_group_id, + _param = self._list_network_area_projects_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11842,7 +20437,7 @@ def get_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "ProjectListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11857,19 +20452,18 @@ def get_security_group_with_http_info( ) @validate_call - def get_security_group_without_preload_content( + def list_network_area_projects_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." + ), ], - security_group_id: Annotated[ + area_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], _request_timeout: Union[ @@ -11882,14 +20476,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. - - 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 + """List all projects using a network area. + + Get a list of all projects using a network area. + + :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 _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 @@ -11912,9 +20506,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( - project_id=project_id, - security_group_id=security_group_id, + _param = self._list_network_area_projects_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11922,7 +20516,7 @@ def get_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "ProjectListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -11932,10 +20526,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 _list_network_area_projects_serialize( self, - project_id, - security_group_id, + organization_id, + area_id, _request_auth, _content_type, _headers, @@ -11954,10 +20548,10 @@ def _get_security_group_serialize( _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 organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id # process the query parameters # process the header parameters # process the form parameters @@ -11972,7 +20566,7 @@ def _get_security_group_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/projects", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11986,28 +20580,18 @@ def _get_security_group_serialize( ) @validate_call - def get_security_group_rule( + def list_network_area_ranges( 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[ + organization_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - security_group_rule_id: Annotated[ + area_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], _request_timeout: Union[ @@ -12019,17 +20603,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. + ) -> NetworkRangeListResponse: + """List all network ranges in a network area. - Get details about a security group rule of a project. + Get a list of all network ranges in a network area. - :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 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 _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 @@ -12052,10 +20634,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( - project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + _param = self._list_network_area_ranges_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12063,7 +20644,7 @@ def get_security_group_rule( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12078,28 +20659,18 @@ def get_security_group_rule( ).data @validate_call - def get_security_group_rule_with_http_info( + def list_network_area_ranges_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[ + organization_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - security_group_rule_id: Annotated[ + area_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], _request_timeout: Union[ @@ -12111,17 +20682,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[NetworkRangeListResponse]: + """List all network ranges in a network area. - Get details about a security group rule of a project. + Get a list of all network ranges in a network area. - :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 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 _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 @@ -12144,10 +20713,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( - project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + _param = self._list_network_area_ranges_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12155,7 +20723,7 @@ def get_security_group_rule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12170,28 +20738,18 @@ def get_security_group_rule_with_http_info( ) @validate_call - def get_security_group_rule_without_preload_content( + def list_network_area_ranges_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[ + organization_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - security_group_rule_id: Annotated[ + area_id: Annotated[ str, Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." ), ], _request_timeout: Union[ @@ -12204,16 +20762,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. + """List all network ranges in a network area. - Get details about a security group rule of a project. + Get a list of all network ranges in a network area. - :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 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 _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 @@ -12236,10 +20792,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( - project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + _param = self._list_network_area_ranges_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12247,7 +20802,7 @@ def get_security_group_rule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12257,11 +20812,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 _list_network_area_ranges_serialize( self, - project_id, - security_group_id, - security_group_rule_id, + organization_id, + area_id, _request_auth, _content_type, _headers, @@ -12280,12 +20834,10 @@ def _get_security_group_rule_serialize( _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 + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id # process the query parameters # process the header parameters # process the form parameters @@ -12300,7 +20852,7 @@ def _get_security_group_rule_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12314,17 +20866,21 @@ def _get_security_group_rule_serialize( ) @validate_call - def get_server( + def list_network_area_routes( 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." + ), ], - server_id: Annotated[ + area_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 Area." + ), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12334,17 +20890,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. + ) -> RouteListResponse: + """List all network routes in a network area. - Get details about a server by its ID. + Get a list of all network routes defined in a network area. - :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 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 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 @@ -12367,10 +20923,10 @@ def get_server( :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, + _param = self._list_network_area_routes_serialize( + organization_id=organization_id, + area_id=area_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12378,7 +20934,7 @@ def get_server( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12393,17 +20949,21 @@ def get_server( ).data @validate_call - def get_server_with_http_info( + def list_network_area_routes_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." + ), ], - server_id: Annotated[ + area_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 Area." + ), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12413,17 +20973,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[RouteListResponse]: + """List all network routes in a network area. - Get details about a server by its ID. + Get a list of all network routes defined in a network area. - :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 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 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 @@ -12446,10 +21006,10 @@ def get_server_with_http_info( :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, + _param = self._list_network_area_routes_serialize( + organization_id=organization_id, + area_id=area_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12457,7 +21017,7 @@ def get_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12472,17 +21032,21 @@ def get_server_with_http_info( ) @validate_call - def get_server_without_preload_content( + def list_network_area_routes_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." + ), ], - server_id: Annotated[ + area_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 Area." + ), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12493,16 +21057,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. + """List all network routes in a network area. - Get details about a server by its ID. + Get a list of all network routes defined in a network area. - :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 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 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 @@ -12525,10 +21089,10 @@ def get_server_without_preload_content( :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, + _param = self._list_network_area_routes_serialize( + organization_id=organization_id, + area_id=area_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12536,7 +21100,7 @@ def get_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12546,11 +21110,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 _list_network_area_routes_serialize( self, - project_id, - server_id, - details, + organization_id, + area_id, + label_selector, _request_auth, _content_type, _headers, @@ -12569,14 +21133,14 @@ def _get_server_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 + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id # process the query parameters - if details is not None: + if label_selector is not None: - _query_params.append(("details", details)) + _query_params.append(("label_selector", label_selector)) # process the header parameters # process the form parameters @@ -12591,7 +21155,7 @@ def _get_server_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12605,16 +21169,15 @@ def _get_server_serialize( ) @validate_call - def get_server_console( + def list_network_areas( 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[ + organization_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 Organization." + ), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12624,15 +21187,15 @@ 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. + ) -> NetworkAreaListResponse: + """List all network areas in an organization. - Get a URL for server remote console. + Get a list of all visible network areas defined in an organization. - :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 organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_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 @@ -12655,9 +21218,9 @@ def get_server_console( :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, + _param = self._list_network_areas_serialize( + organization_id=organization_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12665,7 +21228,7 @@ def get_server_console( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "NetworkAreaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12680,16 +21243,15 @@ def get_server_console( ).data @validate_call - def get_server_console_with_http_info( + def list_network_areas_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[ + organization_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 Organization." + ), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12699,15 +21261,15 @@ 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[NetworkAreaListResponse]: + """List all network areas in an organization. - Get a URL for server remote console. + Get a list of all visible network areas defined in an organization. - :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 organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_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 @@ -12730,9 +21292,9 @@ 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( - project_id=project_id, - server_id=server_id, + _param = self._list_network_areas_serialize( + organization_id=organization_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12740,7 +21302,7 @@ def get_server_console_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "NetworkAreaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12755,16 +21317,15 @@ def get_server_console_with_http_info( ) @validate_call - def get_server_console_without_preload_content( + def list_network_areas_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[ + organization_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 Organization." + ), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12775,14 +21336,14 @@ 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. + """List all network areas in an organization. - Get a URL for server remote console. + Get a list of all visible network areas defined in an organization. - :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 organization_id: The identifier (ID) of a STACKIT Organization. (required) + :type organization_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 @@ -12805,9 +21366,9 @@ 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( - project_id=project_id, - server_id=server_id, + _param = self._list_network_areas_serialize( + organization_id=organization_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12815,7 +21376,7 @@ def get_server_console_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "200": "NetworkAreaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12825,10 +21386,10 @@ 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 _list_network_areas_serialize( self, - project_id, - server_id, + organization_id, + label_selector, _request_auth, _content_type, _headers, @@ -12847,11 +21408,13 @@ def _get_server_console_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 + if organization_id is not None: + _path_params["organizationId"] = organization_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 @@ -12865,7 +21428,7 @@ def _get_server_console_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/console", + resource_path="/v1beta1/organizations/{organizationId}/network-areas", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12879,20 +21442,13 @@ def _get_server_console_serialize( ) @validate_call - def get_server_log( + def list_networks( 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."), - ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12902,17 +21458,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. + ) -> NetworkListResponse: + """List all networks inside a project. - Get server console log. + Get a list of all networks 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 get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :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 @@ -12935,10 +21489,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._list_networks_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12946,7 +21499,7 @@ def get_server_log( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -12961,20 +21514,13 @@ def get_server_log( ).data @validate_call - def get_server_log_with_http_info( + def list_networks_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."), - ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12984,17 +21530,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[NetworkListResponse]: + """List all networks inside a project. - Get server console log. + Get a list of all networks 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 get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :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 @@ -13017,10 +21561,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._list_networks_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13028,7 +21571,7 @@ def get_server_log_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13043,20 +21586,13 @@ def get_server_log_with_http_info( ) @validate_call - def get_server_log_without_preload_content( + def list_networks_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."), - ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13067,16 +21603,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. + """List all networks inside a project. - Get server console log. + Get a list of all networks 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 get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :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 @@ -13099,10 +21633,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._list_networks_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13110,7 +21643,7 @@ def get_server_log_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13120,11 +21653,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 _list_networks_serialize( self, project_id, - server_id, - get_server_log_request, + label_selector, _request_auth, _content_type, _headers, @@ -13145,33 +21677,25 @@ 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 # 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 - 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="/v1beta1/projects/{projectId}/servers/{serverId}/log", + resource_path="/v1beta1/projects/{projectId}/networks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13185,16 +21709,17 @@ def _get_server_log_serialize( ) @validate_call - def get_volume( + def list_nics( 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[ + network_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 Network."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13204,15 +21729,17 @@ 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. + ) -> NICListResponse: + """List all network interfaces inside a network. - Get details about a block device volume. + Get a list of all network interfaces inside a network. :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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_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 @@ -13235,9 +21762,10 @@ def get_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._list_nics_serialize( project_id=project_id, - volume_id=volume_id, + network_id=network_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13245,7 +21773,7 @@ def get_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13260,16 +21788,17 @@ def get_volume( ).data @validate_call - def get_volume_with_http_info( + def list_nics_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[ + network_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 Network."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13279,15 +21808,17 @@ 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[NICListResponse]: + """List all network interfaces inside a network. - Get details about a block device volume. + Get a list of all network interfaces inside a network. :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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_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 @@ -13310,9 +21841,10 @@ 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_nics_serialize( project_id=project_id, - volume_id=volume_id, + network_id=network_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13320,7 +21852,7 @@ def get_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13335,16 +21867,17 @@ def get_volume_with_http_info( ) @validate_call - def get_volume_without_preload_content( + def list_nics_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[ + network_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 Network."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13355,14 +21888,16 @@ 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 network interfaces inside a network. - Get details about a block device volume. + Get a list of all network interfaces inside a network. :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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_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 @@ -13385,9 +21920,10 @@ 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_nics_serialize( project_id=project_id, - volume_id=volume_id, + network_id=network_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13395,7 +21931,7 @@ def get_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13405,10 +21941,11 @@ 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_nics_serialize( self, project_id, - volume_id, + network_id, + label_selector, _request_auth, _content_type, _headers, @@ -13429,9 +21966,13 @@ 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 network_id is not None: + _path_params["networkId"] = network_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 @@ -13445,7 +21986,7 @@ def _get_volume_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/volumes/{volumeId}", + resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13459,15 +22000,13 @@ def _get_volume_serialize( ) @validate_call - def get_volume_performance_class( + def list_project_nics( 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)], @@ -13477,15 +22016,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. + ) -> NICListResponse: + """List all network interfaces inside a project. - Get details about a specific volume performance class. + Get a list of all network interfaces 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 @@ -13508,9 +22047,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_project_nics_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, @@ -13518,7 +22057,7 @@ def get_volume_performance_class( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13533,15 +22072,13 @@ def get_volume_performance_class( ).data @validate_call - def get_volume_performance_class_with_http_info( + def list_project_nics_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)], @@ -13551,15 +22088,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[NICListResponse]: + """List all network interfaces inside a project. - Get details about a specific volume performance class. + Get a list of all network interfaces 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 @@ -13582,9 +22119,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_project_nics_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, @@ -13592,7 +22129,7 @@ def get_volume_performance_class_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13607,15 +22144,13 @@ def get_volume_performance_class_with_http_info( ) @validate_call - def get_volume_performance_class_without_preload_content( + def list_project_nics_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)], @@ -13626,14 +22161,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 network interfaces inside a project. - Get details about a specific volume performance class. + Get a list of all network interfaces 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 @@ -13656,9 +22191,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_project_nics_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, @@ -13666,7 +22201,7 @@ def get_volume_performance_class_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13676,10 +22211,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_project_nics_serialize( self, project_id, - volume_performance_class, + label_selector, _request_auth, _content_type, _headers, @@ -13700,9 +22235,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 @@ -13716,7 +22253,7 @@ def _get_volume_performance_class_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}", + resource_path="/v1beta1/projects/{projectId}/nics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13730,16 +22267,13 @@ def _get_volume_performance_class_serialize( ) @validate_call - def list_attached_volumes( + def list_public_ips( 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)], @@ -13749,15 +22283,15 @@ 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. + ) -> PublicIpListResponse: + """List all public IPs inside a project. - Get a list of all volume attachments of a server. + Get a list of all public IPs 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 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 @@ -13780,9 +22314,9 @@ def list_attached_volumes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_attached_volumes_serialize( + _param = self._list_public_ips_serialize( project_id=project_id, - server_id=server_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13790,7 +22324,7 @@ def list_attached_volumes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "PublicIpListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13805,16 +22339,13 @@ def list_attached_volumes( ).data @validate_call - def list_attached_volumes_with_http_info( + def list_public_ips_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)], @@ -13824,15 +22355,15 @@ 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[PublicIpListResponse]: + """List all public IPs inside a project. - Get a list of all volume attachments of a server. + Get a list of all public IPs 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 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 @@ -13855,9 +22386,9 @@ 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( + _param = self._list_public_ips_serialize( project_id=project_id, - server_id=server_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13865,7 +22396,7 @@ def list_attached_volumes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "PublicIpListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13880,16 +22411,13 @@ def list_attached_volumes_with_http_info( ) @validate_call - def list_attached_volumes_without_preload_content( + def list_public_ips_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)], @@ -13900,14 +22428,14 @@ 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 public IPs inside a project. - Get a list of all volume attachments of a server. + Get a list of all public IPs 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 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 @@ -13930,9 +22458,9 @@ 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( + _param = self._list_public_ips_serialize( project_id=project_id, - server_id=server_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13940,7 +22468,7 @@ def list_attached_volumes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "PublicIpListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -13950,10 +22478,10 @@ 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_public_ips_serialize( self, project_id, - server_id, + label_selector, _request_auth, _content_type, _headers, @@ -13974,9 +22502,11 @@ def _list_attached_volumes_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 # 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 @@ -13990,7 +22520,7 @@ def _list_attached_volumes_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments", + resource_path="/v1beta1/projects/{projectId}/public-ips", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14004,9 +22534,12 @@ def _list_attached_volumes_serialize( ) @validate_call - def list_key_pairs( + def list_quotas( 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)], @@ -14016,13 +22549,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. + ) -> QuotaListResponse: + """List project quotas. - Get a list of all SSH keypairs assigned to the requesting user. + List quota limits and usage for project resources. - :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 @@ -14045,8 +22578,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_quotas_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14054,7 +22587,7 @@ def list_key_pairs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "QuotaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14069,9 +22602,12 @@ def list_key_pairs( ).data @validate_call - def list_key_pairs_with_http_info( + def list_quotas_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)], @@ -14081,13 +22617,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[QuotaListResponse]: + """List project quotas. - Get a list of all SSH keypairs assigned to the requesting user. + List quota limits and usage for project resources. - :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 @@ -14110,8 +22646,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_quotas_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14119,7 +22655,7 @@ def list_key_pairs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "QuotaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14134,9 +22670,12 @@ def list_key_pairs_with_http_info( ) @validate_call - def list_key_pairs_without_preload_content( + def list_quotas_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)], @@ -14147,12 +22686,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 project quotas. - Get a list of all SSH keypairs assigned to the requesting user. + List quota limits and usage for project resources. - :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 @@ -14175,8 +22714,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_quotas_serialize( + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14184,7 +22723,7 @@ def list_key_pairs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "QuotaListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14194,9 +22733,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_quotas_serialize( self, - label_selector, + project_id, _request_auth, _content_type, _headers, @@ -14215,11 +22754,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 @@ -14233,7 +22770,7 @@ def _list_key_pairs_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/keypairs", + resource_path="/v1beta1/projects/{projectId}/quotas", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14247,12 +22784,21 @@ def _list_key_pairs_serialize( ) @validate_call - def list_machine_types( + def list_security_group_rules( 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)], @@ -14262,13 +22808,15 @@ def list_machine_types( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> MachineTypeListResponse: - """List all machine types available for a project. + ) -> SecurityGroupRuleListResponse: + """List all rules for a security group. - Get a list of all machine type available in a project. + Get a list of all rules inside a security group. :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 @@ -14291,8 +22839,9 @@ def list_machine_types( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_machine_types_serialize( + _param = self._list_security_group_rules_serialize( project_id=project_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14300,7 +22849,7 @@ def list_machine_types( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineTypeListResponse", + "200": "SecurityGroupRuleListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14315,12 +22864,21 @@ def list_machine_types( ).data @validate_call - def list_machine_types_with_http_info( + def list_security_group_rules_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.", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14330,13 +22888,15 @@ def list_machine_types_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[MachineTypeListResponse]: - """List all machine types available for a project. + ) -> ApiResponse[SecurityGroupRuleListResponse]: + """List all rules for a security group. - Get a list of all machine type available in a project. + Get a list of all rules inside a security group. :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 @@ -14359,8 +22919,9 @@ def list_machine_types_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_machine_types_serialize( + _param = self._list_security_group_rules_serialize( project_id=project_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14368,7 +22929,7 @@ def list_machine_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineTypeListResponse", + "200": "SecurityGroupRuleListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14383,12 +22944,21 @@ def list_machine_types_with_http_info( ) @validate_call - def list_machine_types_without_preload_content( + def list_security_group_rules_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)], @@ -14399,12 +22969,14 @@ def list_machine_types_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all machine types available for a project. + """List all rules for a security group. - Get a list of all machine type available in a project. + Get a list of all rules inside a security group. :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 @@ -14427,8 +22999,9 @@ def list_machine_types_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_machine_types_serialize( + _param = self._list_security_group_rules_serialize( project_id=project_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14436,7 +23009,7 @@ def list_machine_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineTypeListResponse", + "200": "SecurityGroupRuleListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14446,9 +23019,10 @@ def list_machine_types_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_machine_types_serialize( + def _list_security_group_rules_serialize( self, project_id, + security_group_id, _request_auth, _content_type, _headers, @@ -14469,6 +23043,8 @@ def _list_machine_types_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 # process the query parameters # process the header parameters # process the form parameters @@ -14483,7 +23059,7 @@ def _list_machine_types_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/machine-types", + resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14497,20 +23073,13 @@ def _list_machine_types_serialize( ) @validate_call - def list_network_area_projects( + def list_security_groups( 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."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14520,15 +23089,15 @@ def list_network_area_projects( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProjectListResponse: - """List all projects using a network area. + ) -> SecurityGroupListResponse: + """List all security groups inside a project. - Get a list of all projects using a network area. + Get a list of all security groups inside a project. - :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 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 @@ -14551,9 +23120,9 @@ def list_network_area_projects( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_projects_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._list_security_groups_serialize( + project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14561,7 +23130,7 @@ def list_network_area_projects( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "SecurityGroupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14576,20 +23145,13 @@ def list_network_area_projects( ).data @validate_call - def list_network_area_projects_with_http_info( + def list_security_groups_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."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14599,15 +23161,15 @@ def list_network_area_projects_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[ProjectListResponse]: - """List all projects using a network area. + ) -> ApiResponse[SecurityGroupListResponse]: + """List all security groups inside a project. - Get a list of all projects using a network area. + Get a list of all security groups inside a project. - :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 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 @@ -14630,9 +23192,9 @@ def list_network_area_projects_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_projects_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._list_security_groups_serialize( + project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14640,7 +23202,7 @@ def list_network_area_projects_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "SecurityGroupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14655,20 +23217,13 @@ def list_network_area_projects_with_http_info( ) @validate_call - def list_network_area_projects_without_preload_content( + def list_security_groups_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."), ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14679,14 +23234,14 @@ def list_network_area_projects_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all projects using a network area. + """List all security groups inside a project. - Get a list of all projects using a network area. + Get a list of all security groups inside a project. - :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 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 @@ -14709,9 +23264,9 @@ def list_network_area_projects_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_projects_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._list_security_groups_serialize( + project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14719,7 +23274,7 @@ def list_network_area_projects_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "SecurityGroupListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14729,10 +23284,10 @@ def list_network_area_projects_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_network_area_projects_serialize( + def _list_security_groups_serialize( self, - organization_id, - area_id, + project_id, + label_selector, _request_auth, _content_type, _headers, @@ -14751,11 +23306,13 @@ def _list_network_area_projects_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 # 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 @@ -14769,7 +23326,7 @@ def _list_network_area_projects_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/projects", + resource_path="/v1beta1/projects/{projectId}/security-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14783,19 +23340,15 @@ def _list_network_area_projects_serialize( ) @validate_call - def list_network_area_ranges( + def list_server_nics( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], _request_timeout: Union[ None, @@ -14806,15 +23359,15 @@ def list_network_area_ranges( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkRangeListResponse: - """List all network ranges in a network area. + ) -> NICListResponse: + """Get all network interfaces. - Get a list of all network ranges in a network area. + Get all network interfaces attached to the server. - :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 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 @@ -14837,9 +23390,9 @@ def list_network_area_ranges( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_ranges_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._list_server_nics_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14847,7 +23400,7 @@ def list_network_area_ranges( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14862,19 +23415,15 @@ def list_network_area_ranges( ).data @validate_call - def list_network_area_ranges_with_http_info( + def list_server_nics_with_http_info( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], _request_timeout: Union[ None, @@ -14885,15 +23434,15 @@ def list_network_area_ranges_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[NetworkRangeListResponse]: - """List all network ranges in a network area. + ) -> ApiResponse[NICListResponse]: + """Get all network interfaces. - Get a list of all network ranges in a network area. + Get all network interfaces attached to the server. - :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 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 @@ -14916,9 +23465,9 @@ def list_network_area_ranges_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_ranges_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._list_server_nics_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14926,7 +23475,7 @@ def list_network_area_ranges_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14941,19 +23490,15 @@ def list_network_area_ranges_with_http_info( ) @validate_call - def list_network_area_ranges_without_preload_content( + def list_server_nics_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], _request_timeout: Union[ None, @@ -14965,14 +23510,14 @@ def list_network_area_ranges_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all network ranges in a network area. + """Get all network interfaces. - Get a list of all network ranges in a network area. + Get all network interfaces attached to the server. - :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 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 @@ -14995,9 +23540,9 @@ def list_network_area_ranges_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_ranges_serialize( - organization_id=organization_id, - area_id=area_id, + _param = self._list_server_nics_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15005,7 +23550,7 @@ def list_network_area_ranges_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkRangeListResponse", + "200": "NICListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15015,10 +23560,10 @@ def list_network_area_ranges_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_network_area_ranges_serialize( + def _list_server_nics_serialize( self, - organization_id, - area_id, + project_id, + server_id, _request_auth, _content_type, _headers, @@ -15037,10 +23582,10 @@ def _list_network_area_ranges_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 server_id is not None: + _path_params["serverId"] = server_id # process the query parameters # process the header parameters # process the form parameters @@ -15055,7 +23600,7 @@ def _list_network_area_ranges_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/nics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15069,21 +23614,16 @@ def _list_network_area_ranges_serialize( ) @validate_call - def list_network_area_routes( + def list_server_service_accounts( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15093,17 +23633,15 @@ def list_network_area_routes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RouteListResponse: - """List all network routes in a network area. + ) -> ServiceAccountMailListResponse: + """List all service accounts of the Server. - Get a list of all network routes defined in a network area. + Get the list of the service accounts of the server. - :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 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 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 @@ -15126,10 +23664,9 @@ def list_network_area_routes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_routes_serialize( - organization_id=organization_id, - area_id=area_id, - label_selector=label_selector, + _param = self._list_server_service_accounts_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15137,7 +23674,7 @@ def list_network_area_routes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RouteListResponse", + "200": "ServiceAccountMailListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15152,21 +23689,16 @@ def list_network_area_routes( ).data @validate_call - def list_network_area_routes_with_http_info( + def list_server_service_accounts_with_http_info( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15176,17 +23708,15 @@ def list_network_area_routes_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[RouteListResponse]: - """List all network routes in a network area. + ) -> ApiResponse[ServiceAccountMailListResponse]: + """List all service accounts of the Server. - Get a list of all network routes defined in a network area. + Get the list of the service accounts of the server. - :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 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 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 @@ -15209,10 +23739,9 @@ def list_network_area_routes_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_area_routes_serialize( - organization_id=organization_id, - area_id=area_id, - label_selector=label_selector, + _param = self._list_server_service_accounts_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15220,7 +23749,7 @@ def list_network_area_routes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RouteListResponse", + "200": "ServiceAccountMailListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15235,21 +23764,16 @@ def list_network_area_routes_with_http_info( ) @validate_call - def list_network_area_routes_without_preload_content( + def list_server_service_accounts_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15260,16 +23784,14 @@ def list_network_area_routes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all network routes in a network area. + """List all service accounts of the Server. - Get a list of all network routes defined in a network area. + Get the list of the service accounts of the server. - :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 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 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 @@ -15289,13 +23811,12 @@ def list_network_area_routes_without_preload_content( request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._list_network_area_routes_serialize( - organization_id=organization_id, - area_id=area_id, - label_selector=label_selector, + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_server_service_accounts_serialize( + project_id=project_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15303,7 +23824,7 @@ def list_network_area_routes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RouteListResponse", + "200": "ServiceAccountMailListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15313,11 +23834,10 @@ def list_network_area_routes_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_network_area_routes_serialize( + def _list_server_service_accounts_serialize( self, - organization_id, - area_id, - label_selector, + project_id, + server_id, _request_auth, _content_type, _headers, @@ -15336,15 +23856,11 @@ def _list_network_area_routes_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 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 @@ -15358,7 +23874,7 @@ def _list_network_area_routes_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15372,14 +23888,13 @@ def _list_network_area_routes_serialize( ) @validate_call - def list_network_areas( + def list_servers( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -15390,13 +23905,15 @@ def list_network_areas( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkAreaListResponse: - """List all network areas in an organization. + ) -> ServerListResponse: + """List all servers inside a project. - Get a list of all visible network areas defined in an organization. + Get a list of all servers inside a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param details: Show detailed information about server. + :type details: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -15421,8 +23938,9 @@ def list_network_areas( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_areas_serialize( - organization_id=organization_id, + _param = self._list_servers_serialize( + project_id=project_id, + details=details, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -15431,7 +23949,7 @@ def list_network_areas( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "ServerListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15446,14 +23964,13 @@ def list_network_areas( ).data @validate_call - def list_network_areas_with_http_info( + def list_servers_with_http_info( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -15464,13 +23981,15 @@ def list_network_areas_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[NetworkAreaListResponse]: - """List all network areas in an organization. + ) -> ApiResponse[ServerListResponse]: + """List all servers inside a project. - Get a list of all visible network areas defined in an organization. + Get a list of all servers inside a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param details: Show detailed information about server. + :type details: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -15495,8 +24014,9 @@ def list_network_areas_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_areas_serialize( - organization_id=organization_id, + _param = self._list_servers_serialize( + project_id=project_id, + details=details, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -15505,7 +24025,7 @@ def list_network_areas_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "ServerListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15520,14 +24040,13 @@ def list_network_areas_with_http_info( ) @validate_call - def list_network_areas_without_preload_content( + def list_servers_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -15539,12 +24058,14 @@ def list_network_areas_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all network areas in an organization. + """List all servers inside a project. - Get a list of all visible network areas defined in an organization. + Get a list of all servers inside a project. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param details: Show detailed information about server. + :type details: bool :param label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -15569,8 +24090,9 @@ def list_network_areas_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_network_areas_serialize( - organization_id=organization_id, + _param = self._list_servers_serialize( + project_id=project_id, + details=details, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -15579,7 +24101,7 @@ def list_network_areas_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "ServerListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15589,9 +24111,10 @@ def list_network_areas_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_network_areas_serialize( + def _list_servers_serialize( self, - organization_id, + project_id, + details, label_selector, _request_auth, _content_type, @@ -15611,9 +24134,13 @@ def _list_network_areas_serialize( _body_params: Optional[bytes] = None # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id + if project_id is not None: + _path_params["projectId"] = project_id # process the query parameters + if details is not None: + + _query_params.append(("details", details)) + if label_selector is not None: _query_params.append(("label_selector", label_selector)) @@ -15631,7 +24158,7 @@ def _list_network_areas_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/organizations/{organizationId}/network-areas", + resource_path="/v1beta1/projects/{projectId}/servers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15645,7 +24172,7 @@ def _list_network_areas_serialize( ) @validate_call - def list_networks( + def list_snapshots( self, project_id: Annotated[ str, @@ -15661,10 +24188,10 @@ def list_networks( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkListResponse: - """List all networks inside a project. + ) -> SnapshotListResponse: + """List all snapshots inside a project. - Get a list of all networks inside a project. + Get a list of all snapshots inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -15692,7 +24219,7 @@ def list_networks( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_networks_serialize( + _param = self._list_snapshots_serialize( project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, @@ -15702,7 +24229,7 @@ def list_networks( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "SnapshotListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15717,7 +24244,7 @@ def list_networks( ).data @validate_call - def list_networks_with_http_info( + def list_snapshots_with_http_info( self, project_id: Annotated[ str, @@ -15733,10 +24260,10 @@ def list_networks_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[NetworkListResponse]: - """List all networks inside a project. + ) -> ApiResponse[SnapshotListResponse]: + """List all snapshots inside a project. - Get a list of all networks inside a project. + Get a list of all snapshots inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -15764,7 +24291,7 @@ def list_networks_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_networks_serialize( + _param = self._list_snapshots_serialize( project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, @@ -15774,7 +24301,7 @@ def list_networks_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "SnapshotListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15789,7 +24316,7 @@ def list_networks_with_http_info( ) @validate_call - def list_networks_without_preload_content( + def list_snapshots_without_preload_content( self, project_id: Annotated[ str, @@ -15806,9 +24333,9 @@ def list_networks_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all networks inside a project. + """List all snapshots inside a project. - Get a list of all networks inside a project. + Get a list of all snapshots inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -15836,7 +24363,7 @@ def list_networks_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_networks_serialize( + _param = self._list_snapshots_serialize( project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, @@ -15846,7 +24373,7 @@ def list_networks_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "SnapshotListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15856,7 +24383,7 @@ def list_networks_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_networks_serialize( + def _list_snapshots_serialize( self, project_id, label_selector, @@ -15898,7 +24425,7 @@ def _list_networks_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/networks", + resource_path="/v1beta1/projects/{projectId}/snapshots", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15912,16 +24439,12 @@ def _list_networks_serialize( ) @validate_call - def list_nics( + def list_volume_performance_classes( 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."), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -15932,15 +24455,13 @@ def list_nics( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NICListResponse: - """List all network interfaces inside a network. + ) -> VolumePerformanceClassListResponse: + """List all volume performance classes available for a project. - Get a list of all network interfaces inside a network. + Get a list of all volume performance classes available inside 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 label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -15965,9 +24486,8 @@ def list_nics( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_nics_serialize( + _param = self._list_volume_performance_classes_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -15976,7 +24496,7 @@ def list_nics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "VolumePerformanceClassListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15991,16 +24511,12 @@ def list_nics( ).data @validate_call - def list_nics_with_http_info( + def list_volume_performance_classes_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."), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -16011,15 +24527,13 @@ def list_nics_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[NICListResponse]: - """List all network interfaces inside a network. + ) -> ApiResponse[VolumePerformanceClassListResponse]: + """List all volume performance classes available for a project. - Get a list of all network interfaces inside a network. + Get a list of all volume performance classes available inside 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 label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -16044,9 +24558,8 @@ def list_nics_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_nics_serialize( + _param = self._list_volume_performance_classes_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -16055,7 +24568,7 @@ def list_nics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "VolumePerformanceClassListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -16070,16 +24583,12 @@ def list_nics_with_http_info( ) @validate_call - def list_nics_without_preload_content( + def list_volume_performance_classes_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."), - ], label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, @@ -16091,14 +24600,12 @@ def list_nics_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all network interfaces inside a network. + """List all volume performance classes available for a project. - Get a list of all network interfaces inside a network. + Get a list of all volume performance classes available inside 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 label_selector: Filter resources by labels. :type label_selector: str :param _request_timeout: timeout setting for this request. If one @@ -16123,9 +24630,8 @@ def list_nics_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_nics_serialize( + _param = self._list_volume_performance_classes_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -16134,7 +24640,7 @@ def list_nics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "VolumePerformanceClassListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -16144,10 +24650,9 @@ def list_nics_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_nics_serialize( + def _list_volume_performance_classes_serialize( self, project_id, - network_id, label_selector, _request_auth, _content_type, @@ -16169,8 +24674,6 @@ def _list_nics_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 # process the query parameters if label_selector is not None: @@ -16189,7 +24692,7 @@ def _list_nics_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/networks/{networkId}/nics", + resource_path="/v1beta1/projects/{projectId}/volume-performance-classes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -16203,7 +24706,7 @@ def _list_nics_serialize( ) @validate_call - def list_public_ips( + def list_volumes( self, project_id: Annotated[ str, @@ -16219,10 +24722,10 @@ def list_public_ips( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PublicIpListResponse: - """List all public IPs inside a project. + ) -> VolumeListResponse: + """List all volumes inside a project. - Get a list of all public IPs inside a project. + Get a list of all volumes inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -16250,7 +24753,7 @@ def list_public_ips( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ips_serialize( + _param = self._list_volumes_serialize( project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, @@ -16260,7 +24763,7 @@ def list_public_ips( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "VolumeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -16275,7 +24778,7 @@ def list_public_ips( ).data @validate_call - def list_public_ips_with_http_info( + def list_volumes_with_http_info( self, project_id: Annotated[ str, @@ -16291,10 +24794,10 @@ def list_public_ips_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[PublicIpListResponse]: - """List all public IPs inside a project. + ) -> ApiResponse[VolumeListResponse]: + """List all volumes inside a project. - Get a list of all public IPs inside a project. + Get a list of all volumes inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -16322,7 +24825,7 @@ def list_public_ips_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ips_serialize( + _param = self._list_volumes_serialize( project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, @@ -16332,7 +24835,7 @@ def list_public_ips_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "VolumeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -16347,7 +24850,7 @@ def list_public_ips_with_http_info( ) @validate_call - def list_public_ips_without_preload_content( + def list_volumes_without_preload_content( self, project_id: Annotated[ str, @@ -16364,9 +24867,9 @@ def list_public_ips_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all public IPs inside a project. + """List all volumes inside a project. - Get a list of all public IPs inside a project. + Get a list of all volumes inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -16394,7 +24897,7 @@ def list_public_ips_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ips_serialize( + _param = self._list_volumes_serialize( project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, @@ -16404,7 +24907,7 @@ def list_public_ips_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "VolumeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -16414,7 +24917,7 @@ def list_public_ips_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_public_ips_serialize( + def _list_volumes_serialize( self, project_id, label_selector, @@ -16456,7 +24959,7 @@ def _list_public_ips_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta1/projects/{projectId}/public-ips", + resource_path="/v1beta1/projects/{projectId}/volumes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -16470,20 +24973,18 @@ def _list_public_ips_serialize( ) @validate_call - def list_security_group_rules( + def partial_update_network( 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.", - ), + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + partial_update_network_payload: Annotated[ + PartialUpdateNetworkPayload, Field(description="Request an update of a network.") ], _request_timeout: Union[ None, @@ -16494,15 +24995,17 @@ def list_security_group_rules( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroupRuleListResponse: - """List all rules for a security group. + ) -> None: + """Update network settings. - Get a list of all rules inside a security group. + Update the settings of a network 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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param partial_update_network_payload: Request an update of a network. (required) + :type partial_update_network_payload: PartialUpdateNetworkPayload :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 @@ -16525,9 +25028,10 @@ def list_security_group_rules( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_group_rules_serialize( + _param = self._partial_update_network_serialize( project_id=project_id, - security_group_id=security_group_id, + network_id=network_id, + partial_update_network_payload=partial_update_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16535,7 +25039,7 @@ def list_security_group_rules( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRuleListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -16550,20 +25054,18 @@ def list_security_group_rules( ).data @validate_call - def list_security_group_rules_with_http_info( + def partial_update_network_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[ + network_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 Network."), + ], + partial_update_network_payload: Annotated[ + PartialUpdateNetworkPayload, Field(description="Request an update of a network.") ], _request_timeout: Union[ None, @@ -16574,15 +25076,17 @@ def list_security_group_rules_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[SecurityGroupRuleListResponse]: - """List all rules for a security group. + ) -> ApiResponse[None]: + """Update network settings. - Get a list of all rules inside a security group. + Update the settings of a network 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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param partial_update_network_payload: Request an update of a network. (required) + :type partial_update_network_payload: PartialUpdateNetworkPayload :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 @@ -16605,9 +25109,10 @@ def list_security_group_rules_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_group_rules_serialize( + _param = self._partial_update_network_serialize( project_id=project_id, - security_group_id=security_group_id, + network_id=network_id, + partial_update_network_payload=partial_update_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16615,7 +25120,7 @@ def list_security_group_rules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRuleListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -16630,20 +25135,18 @@ def list_security_group_rules_with_http_info( ) @validate_call - def list_security_group_rules_without_preload_content( + def partial_update_network_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[ + network_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 Network."), + ], + partial_update_network_payload: Annotated[ + PartialUpdateNetworkPayload, Field(description="Request an update of a network.") ], _request_timeout: Union[ None, @@ -16655,14 +25158,16 @@ def list_security_group_rules_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all rules for a security group. + """Update network settings. - Get a list of all rules inside a security group. + Update the settings of a network 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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param partial_update_network_payload: Request an update of a network. (required) + :type partial_update_network_payload: PartialUpdateNetworkPayload :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 @@ -16685,9 +25190,10 @@ def list_security_group_rules_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_group_rules_serialize( + _param = self._partial_update_network_serialize( project_id=project_id, - security_group_id=security_group_id, + network_id=network_id, + partial_update_network_payload=partial_update_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16695,7 +25201,7 @@ def list_security_group_rules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRuleListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -16705,10 +25211,11 @@ def list_security_group_rules_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_security_group_rules_serialize( + def _partial_update_network_serialize( self, project_id, - security_group_id, + network_id, + partial_update_network_payload, _request_auth, _content_type, _headers, @@ -16729,23 +25236,33 @@ def _list_security_group_rules_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 network_id is not None: + _path_params["networkId"] = network_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if partial_update_network_payload is not None: + _body_params = partial_update_network_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="GET", - resource_path="/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules", + method="PATCH", + resource_path="/v1beta1/projects/{projectId}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -16759,13 +25276,23 @@ def _list_security_group_rules_serialize( ) @validate_call - def list_security_groups( + def partial_update_network_area( 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." + ), + ], + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + partial_update_network_area_payload: Annotated[ + PartialUpdateNetworkAreaPayload, Field(description="Request to update an Area.") ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -16775,15 +25302,17 @@ def list_security_groups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroupListResponse: - """List all security groups inside a project. + ) -> NetworkArea: + """Update network area settings. - Get a list of all security groups inside a project. + Update the settings of a network area in an organization. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :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 partial_update_network_area_payload: Request to update an Area. (required) + :type partial_update_network_area_payload: PartialUpdateNetworkAreaPayload :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 @@ -16806,9 +25335,10 @@ def list_security_groups( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_groups_serialize( - project_id=project_id, - label_selector=label_selector, + _param = self._partial_update_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + partial_update_network_area_payload=partial_update_network_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16816,7 +25346,7 @@ def list_security_groups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -16831,13 +25361,23 @@ def list_security_groups( ).data @validate_call - def list_security_groups_with_http_info( + def partial_update_network_area_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." + ), + ], + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + partial_update_network_area_payload: Annotated[ + PartialUpdateNetworkAreaPayload, Field(description="Request to update an Area.") ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -16847,15 +25387,17 @@ def list_security_groups_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[SecurityGroupListResponse]: - """List all security groups inside a project. + ) -> ApiResponse[NetworkArea]: + """Update network area settings. - Get a list of all security groups inside a project. + Update the settings of a network area in an organization. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :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 partial_update_network_area_payload: Request to update an Area. (required) + :type partial_update_network_area_payload: PartialUpdateNetworkAreaPayload :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 @@ -16878,9 +25420,10 @@ def list_security_groups_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_groups_serialize( - project_id=project_id, - label_selector=label_selector, + _param = self._partial_update_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + partial_update_network_area_payload=partial_update_network_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16888,7 +25431,7 @@ def list_security_groups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -16903,13 +25446,23 @@ def list_security_groups_with_http_info( ) @validate_call - def list_security_groups_without_preload_content( + def partial_update_network_area_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." + ), + ], + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + partial_update_network_area_payload: Annotated[ + PartialUpdateNetworkAreaPayload, Field(description="Request to update an Area.") ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -16920,14 +25473,16 @@ def list_security_groups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all security groups inside a project. + """Update network area settings. - Get a list of all security groups inside a project. + Update the settings of a network area in an organization. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :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 partial_update_network_area_payload: Request to update an Area. (required) + :type partial_update_network_area_payload: PartialUpdateNetworkAreaPayload :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 @@ -16950,9 +25505,10 @@ def list_security_groups_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_groups_serialize( - project_id=project_id, - label_selector=label_selector, + _param = self._partial_update_network_area_serialize( + organization_id=organization_id, + area_id=area_id, + partial_update_network_area_payload=partial_update_network_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16960,7 +25516,7 @@ def list_security_groups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -16970,10 +25526,11 @@ def list_security_groups_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_security_groups_serialize( + def _partial_update_network_area_serialize( self, - project_id, - label_selector, + organization_id, + area_id, + partial_update_network_area_payload, _request_auth, _content_type, _headers, @@ -16992,27 +25549,35 @@ def _list_security_groups_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 area_id is not None: + _path_params["areaId"] = area_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 + if partial_update_network_area_payload is not None: + _body_params = partial_update_network_area_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="GET", - resource_path="/v1beta1/projects/{projectId}/security-groups", + method="PATCH", + resource_path="/v1beta1/organizations/{organizationId}/network-areas/{areaId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -17026,7 +25591,7 @@ def _list_security_groups_serialize( ) @validate_call - def list_server_nics( + def reboot_server( self, project_id: Annotated[ str, @@ -17036,6 +25601,7 @@ def list_server_nics( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + action: Annotated[Optional[StrictStr], Field(description="Defines if it is a soft or a hard reboot.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17045,15 +25611,17 @@ def list_server_nics( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NICListResponse: - """Get all network interfaces. + ) -> None: + """Reboot the server. - Get all network interfaces attached to the server. + Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. :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 action: Defines if it is a soft or a hard reboot. + :type action: 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 @@ -17076,9 +25644,10 @@ def list_server_nics( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_nics_serialize( + _param = self._reboot_server_serialize( project_id=project_id, server_id=server_id, + action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17086,11 +25655,12 @@ def list_server_nics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "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) @@ -17101,7 +25671,7 @@ def list_server_nics( ).data @validate_call - def list_server_nics_with_http_info( + def reboot_server_with_http_info( self, project_id: Annotated[ str, @@ -17111,6 +25681,7 @@ def list_server_nics_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + action: Annotated[Optional[StrictStr], Field(description="Defines if it is a soft or a hard reboot.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17120,15 +25691,17 @@ def list_server_nics_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[NICListResponse]: - """Get all network interfaces. + ) -> ApiResponse[None]: + """Reboot the server. - Get all network interfaces attached to the server. + Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. :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 action: Defines if it is a soft or a hard reboot. + :type action: 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 @@ -17151,9 +25724,10 @@ def list_server_nics_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_nics_serialize( + _param = self._reboot_server_serialize( project_id=project_id, server_id=server_id, + action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17161,11 +25735,12 @@ def list_server_nics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "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) @@ -17176,7 +25751,7 @@ def list_server_nics_with_http_info( ) @validate_call - def list_server_nics_without_preload_content( + def reboot_server_without_preload_content( self, project_id: Annotated[ str, @@ -17186,6 +25761,7 @@ def list_server_nics_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + action: Annotated[Optional[StrictStr], Field(description="Defines if it is a soft or a hard reboot.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17196,14 +25772,16 @@ def list_server_nics_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get all network interfaces. + """Reboot the server. - Get all network interfaces attached to the server. + Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. :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 action: Defines if it is a soft or a hard reboot. + :type action: 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 @@ -17226,9 +25804,10 @@ def list_server_nics_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_nics_serialize( + _param = self._reboot_server_serialize( project_id=project_id, server_id=server_id, + action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17236,20 +25815,22 @@ def list_server_nics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "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 _list_server_nics_serialize( + def _reboot_server_serialize( self, project_id, server_id, + action, _request_auth, _content_type, _headers, @@ -17273,6 +25854,10 @@ def _list_server_nics_serialize( if server_id is not None: _path_params["serverId"] = server_id # process the query parameters + if action is not None: + + _query_params.append(("action", action)) + # process the header parameters # process the form parameters # process the body parameter @@ -17285,8 +25870,8 @@ def _list_server_nics_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/nics", + method="POST", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/reboot", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -17300,7 +25885,7 @@ def _list_server_nics_serialize( ) @validate_call - def list_server_service_accounts( + def remove_network_from_server( self, project_id: Annotated[ str, @@ -17310,6 +25895,10 @@ def list_server_service_accounts( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17319,15 +25908,17 @@ def list_server_service_accounts( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServiceAccountMailListResponse: - """List all service accounts of the Server. + ) -> None: + """Detach and delete all network interfaces associated with the specified network. - Get the list of the service accounts of the server. + Detach and delete all network interfaces associated with the specified network from the server. :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 _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 @@ -17350,9 +25941,10 @@ def list_server_service_accounts( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_service_accounts_serialize( + _param = self._remove_network_from_server_serialize( project_id=project_id, server_id=server_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17360,7 +25952,7 @@ def list_server_service_accounts( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -17375,7 +25967,7 @@ def list_server_service_accounts( ).data @validate_call - def list_server_service_accounts_with_http_info( + def remove_network_from_server_with_http_info( self, project_id: Annotated[ str, @@ -17385,6 +25977,10 @@ def list_server_service_accounts_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17394,15 +25990,17 @@ def list_server_service_accounts_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[ServiceAccountMailListResponse]: - """List all service accounts of the Server. + ) -> ApiResponse[None]: + """Detach and delete all network interfaces associated with the specified network. - Get the list of the service accounts of the server. + Detach and delete all network interfaces associated with the specified network from the server. :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 _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 @@ -17425,9 +26023,10 @@ def list_server_service_accounts_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_service_accounts_serialize( + _param = self._remove_network_from_server_serialize( project_id=project_id, server_id=server_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17435,7 +26034,7 @@ def list_server_service_accounts_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -17450,7 +26049,7 @@ def list_server_service_accounts_with_http_info( ) @validate_call - def list_server_service_accounts_without_preload_content( + def remove_network_from_server_without_preload_content( self, project_id: Annotated[ str, @@ -17460,6 +26059,10 @@ def list_server_service_accounts_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17470,14 +26073,16 @@ def list_server_service_accounts_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all service accounts of the Server. + """Detach and delete all network interfaces associated with the specified network. - Get the list of the service accounts of the server. + Detach and delete all network interfaces associated with the specified network from the server. :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 _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 @@ -17500,9 +26105,10 @@ def list_server_service_accounts_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_server_service_accounts_serialize( + _param = self._remove_network_from_server_serialize( project_id=project_id, server_id=server_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17510,7 +26116,7 @@ def list_server_service_accounts_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -17520,10 +26126,11 @@ def list_server_service_accounts_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_server_service_accounts_serialize( + def _remove_network_from_server_serialize( self, project_id, server_id, + network_id, _request_auth, _content_type, _headers, @@ -17546,6 +26153,8 @@ def _list_server_service_accounts_serialize( _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 # process the query parameters # process the header parameters # process the form parameters @@ -17559,8 +26168,8 @@ def _list_server_service_accounts_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts", + method="DELETE", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -17574,14 +26183,20 @@ def _list_server_service_accounts_serialize( ) @validate_call - def list_servers( + def remove_nic_from_server( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -17591,17 +26206,17 @@ def list_servers( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServerListResponse: - """List all servers inside a project. + ) -> None: + """Detach a network interface. - Get a list of all servers inside a project. + Detach a network interface from a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param details: Show detailed information about server. - :type details: bool - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -17624,10 +26239,10 @@ def list_servers( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_servers_serialize( + _param = self._remove_nic_from_server_serialize( project_id=project_id, - details=details, - label_selector=label_selector, + server_id=server_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17635,7 +26250,7 @@ def list_servers( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -17650,14 +26265,20 @@ def list_servers( ).data @validate_call - def list_servers_with_http_info( + def remove_nic_from_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."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -17667,17 +26288,17 @@ def list_servers_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[ServerListResponse]: - """List all servers inside a project. + ) -> ApiResponse[None]: + """Detach a network interface. - Get a list of all servers inside a project. + Detach a network interface from a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param details: Show detailed information about server. - :type details: bool - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -17700,10 +26321,10 @@ def list_servers_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_servers_serialize( + _param = self._remove_nic_from_server_serialize( project_id=project_id, - details=details, - label_selector=label_selector, + server_id=server_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17711,7 +26332,7 @@ def list_servers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -17726,14 +26347,20 @@ def list_servers_with_http_info( ) @validate_call - def list_servers_without_preload_content( + def remove_nic_from_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."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -17744,16 +26371,16 @@ def list_servers_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all servers inside a project. + """Detach a network interface. - Get a list of all servers inside a project. + Detach a network interface from a server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param details: Show detailed information about server. - :type details: bool - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -17776,10 +26403,10 @@ def list_servers_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_servers_serialize( + _param = self._remove_nic_from_server_serialize( project_id=project_id, - details=details, - label_selector=label_selector, + server_id=server_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17787,7 +26414,7 @@ def list_servers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -17797,11 +26424,11 @@ def list_servers_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_servers_serialize( + def _remove_nic_from_server_serialize( self, project_id, - details, - label_selector, + server_id, + nic_id, _request_auth, _content_type, _headers, @@ -17822,15 +26449,11 @@ def _list_servers_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - # process the query parameters - if details is not None: - - _query_params.append(("details", details)) - - if label_selector is not None: - - _query_params.append(("label_selector", label_selector)) - + if server_id is not None: + _path_params["serverId"] = server_id + if nic_id is not None: + _path_params["nicId"] = nic_id + # process the query parameters # process the header parameters # process the form parameters # process the body parameter @@ -17843,8 +26466,8 @@ def _list_servers_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta1/projects/{projectId}/servers", + method="DELETE", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/nics/{nicId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -17858,13 +26481,19 @@ def _list_servers_serialize( ) @validate_call - def list_volume_performance_classes( + def remove_public_ip_from_server( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -17874,15 +26503,17 @@ def list_volume_performance_classes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumePerformanceClassListResponse: - """List all volume performance classes available for a project. + ) -> None: + """Dissociate a public IP from a server. - Get a list of all volume performance classes available inside a project. + Dissociate a public IP on an existing server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -17905,9 +26536,10 @@ def list_volume_performance_classes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_volume_performance_classes_serialize( + _param = self._remove_public_ip_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17915,11 +26547,12 @@ def list_volume_performance_classes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClassListResponse", + "204": 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) @@ -17930,13 +26563,19 @@ def list_volume_performance_classes( ).data @validate_call - def list_volume_performance_classes_with_http_info( + def remove_public_ip_from_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."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -17946,15 +26585,17 @@ def list_volume_performance_classes_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[VolumePerformanceClassListResponse]: - """List all volume performance classes available for a project. + ) -> ApiResponse[None]: + """Dissociate a public IP from a server. - Get a list of all volume performance classes available inside a project. + Dissociate a public IP on an existing server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -17977,9 +26618,10 @@ def list_volume_performance_classes_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_volume_performance_classes_serialize( + _param = self._remove_public_ip_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17987,11 +26629,12 @@ def list_volume_performance_classes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClassListResponse", + "204": 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) @@ -18002,13 +26645,19 @@ def list_volume_performance_classes_with_http_info( ) @validate_call - def list_volume_performance_classes_without_preload_content( + def remove_public_ip_from_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."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -18019,14 +26668,16 @@ def list_volume_performance_classes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all volume performance classes available for a project. + """Dissociate a public IP from a server. - Get a list of all volume performance classes available inside a project. + Dissociate a public IP on an existing server. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -18049,9 +26700,10 @@ def list_volume_performance_classes_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_volume_performance_classes_serialize( + _param = self._remove_public_ip_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18059,20 +26711,22 @@ def list_volume_performance_classes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClassListResponse", + "204": 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 _list_volume_performance_classes_serialize( + def _remove_public_ip_from_server_serialize( self, project_id, - label_selector, + server_id, + public_ip_id, _request_auth, _content_type, _headers, @@ -18093,11 +26747,11 @@ def _list_volume_performance_classes_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 public_ip_id is not None: + _path_params["publicIpId"] = public_ip_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 @@ -18110,8 +26764,8 @@ def _list_volume_performance_classes_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta1/projects/{projectId}/volume-performance-classes", + method="DELETE", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -18125,13 +26779,25 @@ def _list_volume_performance_classes_serialize( ) @validate_call - def list_volumes( + def remove_security_group_from_server( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -18141,15 +26807,17 @@ def list_volumes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeListResponse: - """List all volumes inside a project. + ) -> None: + """Remove a server from a security group. - Get a list of all volumes inside a project. + Remove a server from a attached security group. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -18172,9 +26840,10 @@ def list_volumes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_volumes_serialize( + _param = self._remove_security_group_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18182,11 +26851,12 @@ def list_volumes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeListResponse", + "204": 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) @@ -18197,13 +26867,25 @@ def list_volumes( ).data @validate_call - def list_volumes_with_http_info( + def remove_security_group_from_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."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -18213,15 +26895,17 @@ def list_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[VolumeListResponse]: - """List all volumes inside a project. + ) -> ApiResponse[None]: + """Remove a server from a security group. - Get a list of all volumes inside a project. + Remove a server from a attached security group. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -18244,9 +26928,10 @@ def list_volumes_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_volumes_serialize( + _param = self._remove_security_group_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18254,11 +26939,12 @@ def list_volumes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeListResponse", + "204": 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) @@ -18269,13 +26955,25 @@ def list_volumes_with_http_info( ) @validate_call - def list_volumes_without_preload_content( + def remove_security_group_from_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."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + 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)], @@ -18286,14 +26984,16 @@ def list_volumes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all volumes inside a project. + """Remove a server from a security group. - Get a list of all volumes inside a project. + Remove a server from a attached security group. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param label_selector: Filter resources by labels. - :type label_selector: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_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 @@ -18316,9 +27016,10 @@ def list_volumes_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_volumes_serialize( + _param = self._remove_security_group_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18326,20 +27027,22 @@ def list_volumes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeListResponse", + "204": 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 _list_volumes_serialize( + def _remove_security_group_from_server_serialize( self, project_id, - label_selector, + server_id, + security_group_id, _request_auth, _content_type, _headers, @@ -18360,11 +27063,11 @@ def _list_volumes_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 security_group_id is not None: + _path_params["securityGroupId"] = security_group_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 @@ -18377,8 +27080,8 @@ def _list_volumes_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta1/projects/{projectId}/volumes", + method="DELETE", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -18392,18 +27095,18 @@ def _list_volumes_serialize( ) @validate_call - def partial_update_network( + def remove_service_account_from_server( 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[ + server_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - partial_update_network_payload: Annotated[ - PartialUpdateNetworkPayload, Field(description="Request an update of a network.") + service_account_mail: Annotated[ + str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") ], _request_timeout: Union[ None, @@ -18414,17 +27117,17 @@ def partial_update_network( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update network settings. + ) -> ServiceAccountMailListResponse: + """Detach a service account from a server. - Update the settings of a network inside a project. + Detach an additional service account from the server. :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 partial_update_network_payload: Request an update of a network. (required) - :type partial_update_network_payload: PartialUpdateNetworkPayload + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param service_account_mail: The e-mail address of a service account. (required) + :type service_account_mail: 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 @@ -18447,10 +27150,10 @@ def partial_update_network( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._partial_update_network_serialize( + _param = self._remove_service_account_from_server_serialize( project_id=project_id, - network_id=network_id, - partial_update_network_payload=partial_update_network_payload, + server_id=server_id, + service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18458,11 +27161,12 @@ def partial_update_network( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "ServiceAccountMailListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -18473,18 +27177,18 @@ def partial_update_network( ).data @validate_call - def partial_update_network_with_http_info( + def remove_service_account_from_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."), ], - network_id: Annotated[ + server_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - partial_update_network_payload: Annotated[ - PartialUpdateNetworkPayload, Field(description="Request an update of a network.") + service_account_mail: Annotated[ + str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") ], _request_timeout: Union[ None, @@ -18495,17 +27199,17 @@ def partial_update_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[None]: - """Update network settings. + ) -> ApiResponse[ServiceAccountMailListResponse]: + """Detach a service account from a server. - Update the settings of a network inside a project. + Detach an additional service account from the server. :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 partial_update_network_payload: Request an update of a network. (required) - :type partial_update_network_payload: PartialUpdateNetworkPayload + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param service_account_mail: The e-mail address of a service account. (required) + :type service_account_mail: 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 @@ -18528,10 +27232,10 @@ def partial_update_network_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._partial_update_network_serialize( + _param = self._remove_service_account_from_server_serialize( project_id=project_id, - network_id=network_id, - partial_update_network_payload=partial_update_network_payload, + server_id=server_id, + service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18539,11 +27243,12 @@ def partial_update_network_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "ServiceAccountMailListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -18554,18 +27259,18 @@ def partial_update_network_with_http_info( ) @validate_call - def partial_update_network_without_preload_content( + def remove_service_account_from_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."), ], - network_id: Annotated[ + server_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - partial_update_network_payload: Annotated[ - PartialUpdateNetworkPayload, Field(description="Request an update of a network.") + service_account_mail: Annotated[ + str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") ], _request_timeout: Union[ None, @@ -18577,16 +27282,16 @@ def partial_update_network_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update network settings. + """Detach a service account from a server. - Update the settings of a network inside a project. + Detach an additional service account from the server. :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 partial_update_network_payload: Request an update of a network. (required) - :type partial_update_network_payload: PartialUpdateNetworkPayload + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param service_account_mail: The e-mail address of a service account. (required) + :type service_account_mail: 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 @@ -18609,10 +27314,10 @@ def partial_update_network_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._partial_update_network_serialize( + _param = self._remove_service_account_from_server_serialize( project_id=project_id, - network_id=network_id, - partial_update_network_payload=partial_update_network_payload, + server_id=server_id, + service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18620,21 +27325,22 @@ def partial_update_network_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "ServiceAccountMailListResponse", "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 _partial_update_network_serialize( + def _remove_service_account_from_server_serialize( self, project_id, - network_id, - partial_update_network_payload, + server_id, + service_account_mail, _request_auth, _content_type, _headers, @@ -18655,33 +27361,25 @@ def _partial_update_network_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 server_id is not None: + _path_params["serverId"] = server_id + if service_account_mail is not None: + _path_params["serviceAccountMail"] = service_account_mail # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if partial_update_network_payload is not None: - _body_params = partial_update_network_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="/v1beta1/projects/{projectId}/networks/{networkId}", + method="DELETE", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -18695,22 +27393,19 @@ def _partial_update_network_serialize( ) @validate_call - def partial_update_network_area( + def remove_volume_from_server( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], - partial_update_network_area_payload: Annotated[ - PartialUpdateNetworkAreaPayload, Field(description="Request to update an Area.") + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], _request_timeout: Union[ None, @@ -18721,17 +27416,17 @@ def partial_update_network_area( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkArea: - """Update network area settings. + ) -> None: + """Detach a volume from a server. - Update the settings of a network area in an organization. + Detach an existing volume from an existing server. - :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 partial_update_network_area_payload: Request to update an Area. (required) - :type partial_update_network_area_payload: PartialUpdateNetworkAreaPayload + :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 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 @@ -18754,10 +27449,10 @@ def partial_update_network_area( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._partial_update_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - partial_update_network_area_payload=partial_update_network_area_payload, + _param = self._remove_volume_from_server_serialize( + project_id=project_id, + server_id=server_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18765,11 +27460,12 @@ def partial_update_network_area( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "204": 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) @@ -18780,22 +27476,19 @@ def partial_update_network_area( ).data @validate_call - def partial_update_network_area_with_http_info( + def remove_volume_from_server_with_http_info( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], - partial_update_network_area_payload: Annotated[ - PartialUpdateNetworkAreaPayload, Field(description="Request to update an Area.") + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], _request_timeout: Union[ None, @@ -18806,17 +27499,17 @@ def partial_update_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]: - """Update network area settings. + ) -> ApiResponse[None]: + """Detach a volume from a server. - Update the settings of a network area in an organization. + Detach an existing volume from an existing server. - :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 partial_update_network_area_payload: Request to update an Area. (required) - :type partial_update_network_area_payload: PartialUpdateNetworkAreaPayload + :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 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 @@ -18839,10 +27532,10 @@ def partial_update_network_area_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._partial_update_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - partial_update_network_area_payload=partial_update_network_area_payload, + _param = self._remove_volume_from_server_serialize( + project_id=project_id, + server_id=server_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18850,11 +27543,12 @@ def partial_update_network_area_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "204": 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) @@ -18865,22 +27559,19 @@ def partial_update_network_area_with_http_info( ) @validate_call - def partial_update_network_area_without_preload_content( + def remove_volume_from_server_without_preload_content( self, - organization_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - area_id: Annotated[ + server_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 Server."), ], - partial_update_network_area_payload: Annotated[ - PartialUpdateNetworkAreaPayload, Field(description="Request to update an Area.") + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], _request_timeout: Union[ None, @@ -18892,16 +27583,16 @@ def partial_update_network_area_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update network area settings. + """Detach a volume from a server. - Update the settings of a network area in an organization. + Detach an existing volume from an existing server. - :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 partial_update_network_area_payload: Request to update an Area. (required) - :type partial_update_network_area_payload: PartialUpdateNetworkAreaPayload + :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 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 @@ -18924,10 +27615,10 @@ def partial_update_network_area_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._partial_update_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - partial_update_network_area_payload=partial_update_network_area_payload, + _param = self._remove_volume_from_server_serialize( + project_id=project_id, + server_id=server_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18935,21 +27626,22 @@ def partial_update_network_area_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "204": 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 _partial_update_network_area_serialize( + def _remove_volume_from_server_serialize( self, - organization_id, - area_id, - partial_update_network_area_payload, + project_id, + server_id, + volume_id, _request_auth, _content_type, _headers, @@ -18966,37 +27658,29 @@ def _partial_update_network_area_serialize( _form_params: List[Tuple[str, str]] = [] _files: Dict[str, Union[str, bytes]] = {} _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 + + # 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 partial_update_network_area_payload is not None: - _body_params = partial_update_network_area_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="/v1beta1/organizations/{organizationId}/network-areas/{areaId}", + method="DELETE", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -19010,7 +27694,7 @@ def _partial_update_network_area_serialize( ) @validate_call - def reboot_server( + def rescue_server( self, project_id: Annotated[ str, @@ -19020,7 +27704,7 @@ def reboot_server( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - action: Annotated[Optional[StrictStr], Field(description="Defines if it is a soft or a hard reboot.")] = None, + rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19031,16 +27715,16 @@ def reboot_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Reboot the server. + """Rescue an existing server. - Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. :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 action: Defines if it is a soft or a hard reboot. - :type action: str + :param rescue_server_payload: Request a server rescue. (required) + :type rescue_server_payload: RescueServerPayload :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 @@ -19063,10 +27747,10 @@ def reboot_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._reboot_server_serialize( + _param = self._rescue_server_serialize( project_id=project_id, server_id=server_id, - action=action, + rescue_server_payload=rescue_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19090,7 +27774,7 @@ def reboot_server( ).data @validate_call - def reboot_server_with_http_info( + def rescue_server_with_http_info( self, project_id: Annotated[ str, @@ -19100,7 +27784,7 @@ def reboot_server_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - action: Annotated[Optional[StrictStr], Field(description="Defines if it is a soft or a hard reboot.")] = None, + rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19111,16 +27795,16 @@ def reboot_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Reboot the server. + """Rescue an existing server. - Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. :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 action: Defines if it is a soft or a hard reboot. - :type action: str + :param rescue_server_payload: Request a server rescue. (required) + :type rescue_server_payload: RescueServerPayload :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 @@ -19143,10 +27827,10 @@ def reboot_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._reboot_server_serialize( + _param = self._rescue_server_serialize( project_id=project_id, server_id=server_id, - action=action, + rescue_server_payload=rescue_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19170,7 +27854,7 @@ def reboot_server_with_http_info( ) @validate_call - def reboot_server_without_preload_content( + def rescue_server_without_preload_content( self, project_id: Annotated[ str, @@ -19180,7 +27864,7 @@ def reboot_server_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - action: Annotated[Optional[StrictStr], Field(description="Defines if it is a soft or a hard reboot.")] = None, + rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19191,16 +27875,16 @@ def reboot_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Reboot the server. + """Rescue an existing server. - Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. :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 action: Defines if it is a soft or a hard reboot. - :type action: str + :param rescue_server_payload: Request a server rescue. (required) + :type rescue_server_payload: RescueServerPayload :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 @@ -19223,10 +27907,10 @@ def reboot_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._reboot_server_serialize( + _param = self._rescue_server_serialize( project_id=project_id, server_id=server_id, - action=action, + rescue_server_payload=rescue_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19245,11 +27929,11 @@ def reboot_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _reboot_server_serialize( + def _rescue_server_serialize( self, project_id, server_id, - action, + rescue_server_payload, _request_auth, _content_type, _headers, @@ -19273,24 +27957,30 @@ def _reboot_server_serialize( if server_id is not None: _path_params["serverId"] = server_id # process the query parameters - if action is not None: - - _query_params.append(("action", action)) - # process the header parameters # process the form parameters # process the body parameter + if rescue_server_payload is not None: + _body_params = rescue_server_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="/v1beta1/projects/{projectId}/servers/{serverId}/reboot", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/rescue", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -19304,7 +27994,7 @@ def _reboot_server_serialize( ) @validate_call - def remove_network_from_server( + def resize_server( self, project_id: Annotated[ str, @@ -19314,10 +28004,7 @@ def remove_network_from_server( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19328,16 +28015,16 @@ def remove_network_from_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Detach and delete all network interfaces associated with the specified network. + """Resize a server. - Detach and delete all network interfaces associated with the specified network from the server. + Resize the server to the given machine type. :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 resize_server_payload: Request a resize of a server. (required) + :type resize_server_payload: ResizeServerPayload :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 @@ -19360,10 +28047,10 @@ def remove_network_from_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_network_from_server_serialize( + _param = self._resize_server_serialize( project_id=project_id, server_id=server_id, - network_id=network_id, + resize_server_payload=resize_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19371,11 +28058,12 @@ def remove_network_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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) @@ -19386,7 +28074,7 @@ def remove_network_from_server( ).data @validate_call - def remove_network_from_server_with_http_info( + def resize_server_with_http_info( self, project_id: Annotated[ str, @@ -19396,10 +28084,7 @@ def remove_network_from_server_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19410,16 +28095,16 @@ def remove_network_from_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Detach and delete all network interfaces associated with the specified network. + """Resize a server. - Detach and delete all network interfaces associated with the specified network from the server. + Resize the server to the given machine type. :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 resize_server_payload: Request a resize of a server. (required) + :type resize_server_payload: ResizeServerPayload :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 @@ -19442,10 +28127,10 @@ def remove_network_from_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_network_from_server_serialize( + _param = self._resize_server_serialize( project_id=project_id, server_id=server_id, - network_id=network_id, + resize_server_payload=resize_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19453,11 +28138,12 @@ def remove_network_from_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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) @@ -19468,7 +28154,7 @@ def remove_network_from_server_with_http_info( ) @validate_call - def remove_network_from_server_without_preload_content( + def resize_server_without_preload_content( self, project_id: Annotated[ str, @@ -19478,10 +28164,7 @@ def remove_network_from_server_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], + resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19492,16 +28175,16 @@ def remove_network_from_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Detach and delete all network interfaces associated with the specified network. + """Resize a server. - Detach and delete all network interfaces associated with the specified network from the server. + Resize the server to the given machine type. :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 resize_server_payload: Request a resize of a server. (required) + :type resize_server_payload: ResizeServerPayload :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 @@ -19524,10 +28207,10 @@ def remove_network_from_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_network_from_server_serialize( + _param = self._resize_server_serialize( project_id=project_id, server_id=server_id, - network_id=network_id, + resize_server_payload=resize_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19535,21 +28218,22 @@ def remove_network_from_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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 _remove_network_from_server_serialize( + def _resize_server_serialize( self, project_id, server_id, - network_id, + resize_server_payload, _request_auth, _content_type, _headers, @@ -19572,23 +28256,31 @@ def _remove_network_from_server_serialize( _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 # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if resize_server_payload is not None: + _body_params = resize_server_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="DELETE", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/networks/{networkId}", + method="POST", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/resize", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -19602,20 +28294,19 @@ def _remove_network_from_server_serialize( ) @validate_call - def remove_nic_from_server( + def resize_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[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], + resize_volume_payload: Annotated[ + Optional[ResizeVolumePayload], Field(description="Request a volume resize.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19626,16 +28317,16 @@ def remove_nic_from_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Detach a network interface. + """Update the size of a volume. - Detach a network interface from a server. + Update the size of a block device volume. The new volume size must be larger than the current size. :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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param resize_volume_payload: Request a volume resize. + :type resize_volume_payload: ResizeVolumePayload :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 @@ -19658,10 +28349,10 @@ def remove_nic_from_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_nic_from_server_serialize( + _param = self._resize_volume_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + volume_id=volume_id, + resize_volume_payload=resize_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19669,11 +28360,12 @@ def remove_nic_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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) @@ -19684,20 +28376,19 @@ def remove_nic_from_server( ).data @validate_call - def remove_nic_from_server_with_http_info( + def resize_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[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], + resize_volume_payload: Annotated[ + Optional[ResizeVolumePayload], Field(description="Request a volume resize.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19708,16 +28399,16 @@ def remove_nic_from_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Detach a network interface. + """Update the size of a volume. - Detach a network interface from a server. + Update the size of a block device volume. The new volume size must be larger than the current size. :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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param resize_volume_payload: Request a volume resize. + :type resize_volume_payload: ResizeVolumePayload :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 @@ -19740,10 +28431,10 @@ def remove_nic_from_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_nic_from_server_serialize( + _param = self._resize_volume_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + volume_id=volume_id, + resize_volume_payload=resize_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19751,11 +28442,12 @@ def remove_nic_from_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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) @@ -19766,20 +28458,19 @@ def remove_nic_from_server_with_http_info( ) @validate_call - def remove_nic_from_server_without_preload_content( + def resize_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[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], + resize_volume_payload: Annotated[ + Optional[ResizeVolumePayload], Field(description="Request a volume resize.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -19790,16 +28481,16 @@ def remove_nic_from_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Detach a network interface. + """Update the size of a volume. - Detach a network interface from a server. + Update the size of a block device volume. The new volume size must be larger than the current size. :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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param resize_volume_payload: Request a volume resize. + :type resize_volume_payload: ResizeVolumePayload :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 @@ -19822,10 +28513,10 @@ def remove_nic_from_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_nic_from_server_serialize( + _param = self._resize_volume_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + volume_id=volume_id, + resize_volume_payload=resize_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19833,21 +28524,22 @@ def remove_nic_from_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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 _remove_nic_from_server_serialize( + def _resize_volume_serialize( self, project_id, - server_id, - nic_id, + volume_id, + resize_volume_payload, _request_auth, _content_type, _headers, @@ -19868,25 +28560,33 @@ def _remove_nic_from_server_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 nic_id is not None: - _path_params["nicId"] = nic_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 resize_volume_payload is not None: + _body_params = resize_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="DELETE", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/nics/{nicId}", + method="POST", + resource_path="/v1beta1/projects/{projectId}/volumes/{volumeId}/resize", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -19900,18 +28600,15 @@ def _remove_nic_from_server_serialize( ) @validate_call - def remove_public_ip_from_server( + def restore_backup( 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[ + backup_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), ], _request_timeout: Union[ None, @@ -19923,16 +28620,14 @@ def remove_public_ip_from_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Dissociate a public IP from a server. + """Restore Backup to the referenced source Volume. - Dissociate a public IP on an existing server. + Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. :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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_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 @@ -19955,10 +28650,9 @@ def remove_public_ip_from_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_public_ip_from_server_serialize( + _param = self._restore_backup_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19966,12 +28660,11 @@ def remove_public_ip_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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) @@ -19982,18 +28675,15 @@ def remove_public_ip_from_server( ).data @validate_call - def remove_public_ip_from_server_with_http_info( + def restore_backup_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[ + backup_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), ], _request_timeout: Union[ None, @@ -20005,16 +28695,14 @@ def remove_public_ip_from_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Dissociate a public IP from a server. + """Restore Backup to the referenced source Volume. - Dissociate a public IP on an existing server. + Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. :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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_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 @@ -20037,10 +28725,9 @@ def remove_public_ip_from_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_public_ip_from_server_serialize( + _param = self._restore_backup_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20048,12 +28735,11 @@ def remove_public_ip_from_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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) @@ -20064,18 +28750,15 @@ def remove_public_ip_from_server_with_http_info( ) @validate_call - def remove_public_ip_from_server_without_preload_content( + def restore_backup_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[ + backup_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), ], _request_timeout: Union[ None, @@ -20087,16 +28770,14 @@ def remove_public_ip_from_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Dissociate a public IP from a server. + """Restore Backup to the referenced source Volume. - Dissociate a public IP on an existing server. + Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. :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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_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 @@ -20119,10 +28800,9 @@ def remove_public_ip_from_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_public_ip_from_server_serialize( + _param = self._restore_backup_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20130,22 +28810,20 @@ def remove_public_ip_from_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "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 _remove_public_ip_from_server_serialize( + def _restore_backup_serialize( self, project_id, - server_id, - public_ip_id, + backup_id, _request_auth, _content_type, _headers, @@ -20166,10 +28844,8 @@ def _remove_public_ip_from_server_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 public_ip_id is not None: - _path_params["publicIpId"] = public_ip_id + if backup_id is not None: + _path_params["backupId"] = backup_id # process the query parameters # process the header parameters # process the form parameters @@ -20183,8 +28859,8 @@ def _remove_public_ip_from_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}", + method="POST", + resource_path="/v1beta1/projects/{projectId}/backups/{backupId}/restore", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -20198,25 +28874,16 @@ def _remove_public_ip_from_server_serialize( ) @validate_call - def remove_security_group_from_server( + def set_image_share( 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."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], + set_image_share_payload: Annotated[SetImageSharePayload, Field(description="Settings for an Image Share.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20226,17 +28893,17 @@ def remove_security_group_from_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Remove a server from a security group. + ) -> ImageShare: + """Set image share. - Remove a server from a attached security group. + Set share of an Image. New Options will replace existing settings. :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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param set_image_share_payload: Settings for an Image Share. (required) + :type set_image_share_payload: SetImageSharePayload :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 @@ -20259,10 +28926,10 @@ def remove_security_group_from_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_security_group_from_server_serialize( + _param = self._set_image_share_serialize( project_id=project_id, - server_id=server_id, - security_group_id=security_group_id, + image_id=image_id, + set_image_share_payload=set_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20270,12 +28937,11 @@ def remove_security_group_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ImageShare", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -20286,25 +28952,16 @@ def remove_security_group_from_server( ).data @validate_call - def remove_security_group_from_server_with_http_info( + def set_image_share_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."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], + set_image_share_payload: Annotated[SetImageSharePayload, Field(description="Settings for an Image Share.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20314,17 +28971,17 @@ def remove_security_group_from_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[None]: - """Remove a server from a security group. + ) -> ApiResponse[ImageShare]: + """Set image share. - Remove a server from a attached security group. + Set share of an Image. New Options will replace existing settings. :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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param set_image_share_payload: Settings for an Image Share. (required) + :type set_image_share_payload: SetImageSharePayload :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 @@ -20347,10 +29004,10 @@ def remove_security_group_from_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_security_group_from_server_serialize( + _param = self._set_image_share_serialize( project_id=project_id, - server_id=server_id, - security_group_id=security_group_id, + image_id=image_id, + set_image_share_payload=set_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20358,12 +29015,11 @@ def remove_security_group_from_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ImageShare", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -20374,25 +29030,16 @@ def remove_security_group_from_server_with_http_info( ) @validate_call - def remove_security_group_from_server_without_preload_content( + def set_image_share_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."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], + set_image_share_payload: Annotated[SetImageSharePayload, Field(description="Settings for an Image Share.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20403,16 +29050,16 @@ def remove_security_group_from_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Remove a server from a security group. + """Set image share. - Remove a server from a attached security group. + Set share of an Image. New Options will replace existing settings. :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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param set_image_share_payload: Settings for an Image Share. (required) + :type set_image_share_payload: SetImageSharePayload :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 @@ -20435,10 +29082,10 @@ def remove_security_group_from_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_security_group_from_server_serialize( + _param = self._set_image_share_serialize( project_id=project_id, - server_id=server_id, - security_group_id=security_group_id, + image_id=image_id, + set_image_share_payload=set_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20446,22 +29093,21 @@ def remove_security_group_from_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ImageShare", "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 _remove_security_group_from_server_serialize( + def _set_image_share_serialize( self, project_id, - server_id, - security_group_id, + image_id, + set_image_share_payload, _request_auth, _content_type, _headers, @@ -20482,25 +29128,33 @@ def _remove_security_group_from_server_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 security_group_id is not None: - _path_params["securityGroupId"] = security_group_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 set_image_share_payload is not None: + _body_params = set_image_share_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="DELETE", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}", + method="PUT", + resource_path="/v1beta1/projects/{projectId}/images/{imageId}/share", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -20514,7 +29168,7 @@ def _remove_security_group_from_server_serialize( ) @validate_call - def remove_service_account_from_server( + def start_server( self, project_id: Annotated[ str, @@ -20524,9 +29178,6 @@ def remove_service_account_from_server( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - service_account_mail: Annotated[ - str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20536,17 +29187,15 @@ def remove_service_account_from_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServiceAccountMailListResponse: - """Detach a service account from a server. + ) -> None: + """Boot up a server. - Detach an additional service account from the server. + Start an existing server or allocates the server if deallocated. :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 service_account_mail: The e-mail address of a service account. (required) - :type service_account_mail: 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 @@ -20569,10 +29218,9 @@ def remove_service_account_from_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_service_account_from_server_serialize( + _param = self._start_server_serialize( project_id=project_id, server_id=server_id, - service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20580,7 +29228,7 @@ def remove_service_account_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -20596,7 +29244,7 @@ def remove_service_account_from_server( ).data @validate_call - def remove_service_account_from_server_with_http_info( + def start_server_with_http_info( self, project_id: Annotated[ str, @@ -20606,9 +29254,6 @@ def remove_service_account_from_server_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - service_account_mail: Annotated[ - str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20618,17 +29263,15 @@ def remove_service_account_from_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[ServiceAccountMailListResponse]: - """Detach a service account from a server. + ) -> ApiResponse[None]: + """Boot up a server. - Detach an additional service account from the server. + Start an existing server or allocates the server if deallocated. :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 service_account_mail: The e-mail address of a service account. (required) - :type service_account_mail: 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 @@ -20651,10 +29294,9 @@ def remove_service_account_from_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_service_account_from_server_serialize( + _param = self._start_server_serialize( project_id=project_id, server_id=server_id, - service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20662,7 +29304,7 @@ def remove_service_account_from_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -20678,7 +29320,7 @@ def remove_service_account_from_server_with_http_info( ) @validate_call - def remove_service_account_from_server_without_preload_content( + def start_server_without_preload_content( self, project_id: Annotated[ str, @@ -20688,9 +29330,6 @@ def remove_service_account_from_server_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - service_account_mail: Annotated[ - str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20701,16 +29340,14 @@ def remove_service_account_from_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Detach a service account from a server. + """Boot up a server. - Detach an additional service account from the server. + Start an existing server or allocates the server if deallocated. :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 service_account_mail: The e-mail address of a service account. (required) - :type service_account_mail: 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 @@ -20733,10 +29370,9 @@ def remove_service_account_from_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_service_account_from_server_serialize( + _param = self._start_server_serialize( project_id=project_id, server_id=server_id, - service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20744,7 +29380,7 @@ def remove_service_account_from_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -20755,11 +29391,10 @@ def remove_service_account_from_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _remove_service_account_from_server_serialize( + def _start_server_serialize( self, project_id, server_id, - service_account_mail, _request_auth, _content_type, _headers, @@ -20782,8 +29417,6 @@ def _remove_service_account_from_server_serialize( _path_params["projectId"] = project_id if server_id is not None: _path_params["serverId"] = server_id - if service_account_mail is not None: - _path_params["serviceAccountMail"] = service_account_mail # process the query parameters # process the header parameters # process the form parameters @@ -20797,8 +29430,8 @@ def _remove_service_account_from_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}", + method="POST", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/start", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -20812,7 +29445,7 @@ def _remove_service_account_from_server_serialize( ) @validate_call - def remove_volume_from_server( + def stop_server( self, project_id: Annotated[ str, @@ -20822,10 +29455,6 @@ def remove_volume_from_server( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20836,16 +29465,14 @@ def remove_volume_from_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Detach a volume from a server. + """Stop an existing server. - Detach an existing volume from an existing server. + Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. :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 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 @@ -20868,10 +29495,9 @@ def remove_volume_from_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_volume_from_server_serialize( + _param = self._stop_server_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20879,7 +29505,7 @@ def remove_volume_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -20895,7 +29521,7 @@ def remove_volume_from_server( ).data @validate_call - def remove_volume_from_server_with_http_info( + def stop_server_with_http_info( self, project_id: Annotated[ str, @@ -20905,10 +29531,6 @@ def remove_volume_from_server_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20919,16 +29541,14 @@ def remove_volume_from_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Detach a volume from a server. + """Stop an existing server. - Detach an existing volume from an existing server. + Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. :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 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 @@ -20951,10 +29571,9 @@ def remove_volume_from_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_volume_from_server_serialize( + _param = self._stop_server_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20962,7 +29581,7 @@ def remove_volume_from_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -20978,7 +29597,7 @@ def remove_volume_from_server_with_http_info( ) @validate_call - def remove_volume_from_server_without_preload_content( + def stop_server_without_preload_content( self, project_id: Annotated[ str, @@ -20988,10 +29607,6 @@ def remove_volume_from_server_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21002,16 +29617,14 @@ def remove_volume_from_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Detach a volume from a server. + """Stop an existing server. - Detach an existing volume from an existing server. + Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. :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 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 @@ -21034,10 +29647,9 @@ def remove_volume_from_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_volume_from_server_serialize( + _param = self._stop_server_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21045,7 +29657,7 @@ def remove_volume_from_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -21056,11 +29668,10 @@ def remove_volume_from_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _remove_volume_from_server_serialize( + def _stop_server_serialize( self, project_id, server_id, - volume_id, _request_auth, _content_type, _headers, @@ -21083,8 +29694,6 @@ def _remove_volume_from_server_serialize( _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 @@ -21098,8 +29707,8 @@ def _remove_volume_from_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", + method="POST", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/stop", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -21113,7 +29722,7 @@ def _remove_volume_from_server_serialize( ) @validate_call - def rescue_server( + def unrescue_server( self, project_id: Annotated[ str, @@ -21123,7 +29732,6 @@ def rescue_server( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21134,16 +29742,14 @@ def rescue_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Rescue an existing server. + """Unrescue an existing server. - Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. :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 rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload :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 @@ -21166,10 +29772,9 @@ def rescue_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._rescue_server_serialize( + _param = self._unrescue_server_serialize( project_id=project_id, server_id=server_id, - rescue_server_payload=rescue_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21193,7 +29798,7 @@ def rescue_server( ).data @validate_call - def rescue_server_with_http_info( + def unrescue_server_with_http_info( self, project_id: Annotated[ str, @@ -21203,7 +29808,6 @@ def rescue_server_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21214,16 +29818,14 @@ def rescue_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Rescue an existing server. + """Unrescue an existing server. - Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. :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 rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload :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 @@ -21246,10 +29848,9 @@ def rescue_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._rescue_server_serialize( + _param = self._unrescue_server_serialize( project_id=project_id, server_id=server_id, - rescue_server_payload=rescue_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21273,7 +29874,7 @@ def rescue_server_with_http_info( ) @validate_call - def rescue_server_without_preload_content( + def unrescue_server_without_preload_content( self, project_id: Annotated[ str, @@ -21283,7 +29884,6 @@ def rescue_server_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21294,16 +29894,14 @@ def rescue_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Rescue an existing server. + """Unrescue an existing server. - Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. :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 rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload :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 @@ -21326,10 +29924,9 @@ def rescue_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._rescue_server_serialize( + _param = self._unrescue_server_serialize( project_id=project_id, server_id=server_id, - rescue_server_payload=rescue_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21348,11 +29945,10 @@ def rescue_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _rescue_server_serialize( + def _unrescue_server_serialize( self, project_id, server_id, - rescue_server_payload, _request_auth, _content_type, _headers, @@ -21379,27 +29975,17 @@ def _rescue_server_serialize( # process the header parameters # process the form parameters # process the body parameter - if rescue_server_payload is not None: - _body_params = rescue_server_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="/v1beta1/projects/{projectId}/servers/{serverId}/rescue", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/unrescue", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -21413,7 +29999,7 @@ def _rescue_server_serialize( ) @validate_call - def resize_server( + def update_attached_volume( self, project_id: Annotated[ str, @@ -21423,7 +30009,13 @@ def resize_server( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], + update_attached_volume_payload: Annotated[ + UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21433,17 +30025,19 @@ def resize_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Resize a server. + ) -> VolumeAttachment: + """Update Volume Attachment Parameters. - Resize the server to the given machine type. + Update the properties of an existing Volume Attachment. :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 resize_server_payload: Request a resize of a server. (required) - :type resize_server_payload: ResizeServerPayload + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param update_attached_volume_payload: Request a volume attachment update. (required) + :type update_attached_volume_payload: UpdateAttachedVolumePayload :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 @@ -21466,10 +30060,11 @@ def resize_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._resize_server_serialize( + _param = self._update_attached_volume_serialize( project_id=project_id, server_id=server_id, - resize_server_payload=resize_server_payload, + volume_id=volume_id, + update_attached_volume_payload=update_attached_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21477,12 +30072,11 @@ def resize_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "VolumeAttachment", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -21493,7 +30087,7 @@ def resize_server( ).data @validate_call - def resize_server_with_http_info( + def update_attached_volume_with_http_info( self, project_id: Annotated[ str, @@ -21503,7 +30097,13 @@ def resize_server_with_http_info( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], + update_attached_volume_payload: Annotated[ + UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21513,17 +30113,19 @@ def resize_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[None]: - """Resize a server. + ) -> ApiResponse[VolumeAttachment]: + """Update Volume Attachment Parameters. - Resize the server to the given machine type. + Update the properties of an existing Volume Attachment. :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 resize_server_payload: Request a resize of a server. (required) - :type resize_server_payload: ResizeServerPayload + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param update_attached_volume_payload: Request a volume attachment update. (required) + :type update_attached_volume_payload: UpdateAttachedVolumePayload :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 @@ -21546,10 +30148,11 @@ def resize_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._resize_server_serialize( + _param = self._update_attached_volume_serialize( project_id=project_id, server_id=server_id, - resize_server_payload=resize_server_payload, + volume_id=volume_id, + update_attached_volume_payload=update_attached_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21557,12 +30160,11 @@ def resize_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "VolumeAttachment", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -21573,7 +30175,7 @@ def resize_server_with_http_info( ) @validate_call - def resize_server_without_preload_content( + def update_attached_volume_without_preload_content( self, project_id: Annotated[ str, @@ -21583,7 +30185,13 @@ def resize_server_without_preload_content( str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], + volume_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + ], + update_attached_volume_payload: Annotated[ + UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21594,16 +30202,18 @@ def resize_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Resize a server. + """Update Volume Attachment Parameters. - Resize the server to the given machine type. + Update the properties of an existing Volume Attachment. :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 resize_server_payload: Request a resize of a server. (required) - :type resize_server_payload: ResizeServerPayload + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param update_attached_volume_payload: Request a volume attachment update. (required) + :type update_attached_volume_payload: UpdateAttachedVolumePayload :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 @@ -21626,10 +30236,11 @@ def resize_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._resize_server_serialize( + _param = self._update_attached_volume_serialize( project_id=project_id, server_id=server_id, - resize_server_payload=resize_server_payload, + volume_id=volume_id, + update_attached_volume_payload=update_attached_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21637,22 +30248,22 @@ def resize_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "VolumeAttachment", "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 _resize_server_serialize( + def _update_attached_volume_serialize( self, project_id, server_id, - resize_server_payload, + volume_id, + update_attached_volume_payload, _request_auth, _content_type, _headers, @@ -21675,12 +30286,14 @@ def _resize_server_serialize( _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 resize_server_payload is not None: - _body_params = resize_server_payload + if update_attached_volume_payload is not None: + _body_params = update_attached_volume_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -21698,8 +30311,8 @@ def _resize_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/resize", + method="PATCH", + resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -21713,19 +30326,17 @@ def _resize_server_serialize( ) @validate_call - def resize_volume( + def update_backup( 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[ + backup_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 Backup."), ], - resize_volume_payload: Annotated[ - Optional[ResizeVolumePayload], Field(description="Request a volume resize.") - ] = None, + update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21735,17 +30346,17 @@ def resize_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the size of a volume. + ) -> Backup: + """Update information of a backup. - Update the size of a block device volume. The new volume size must be larger than the current size. + Update name or labels of the backup. :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 resize_volume_payload: Request a volume resize. - :type resize_volume_payload: ResizeVolumePayload + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_id: str + :param update_backup_payload: Request an update of a backup. (required) + :type update_backup_payload: UpdateBackupPayload :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 @@ -21768,10 +30379,10 @@ def resize_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._resize_volume_serialize( + _param = self._update_backup_serialize( project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, + backup_id=backup_id, + update_backup_payload=update_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21779,12 +30390,11 @@ def resize_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Backup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -21795,19 +30405,17 @@ def resize_volume( ).data @validate_call - def resize_volume_with_http_info( + def update_backup_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[ + backup_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 Backup."), ], - resize_volume_payload: Annotated[ - Optional[ResizeVolumePayload], Field(description="Request a volume resize.") - ] = None, + update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21817,17 +30425,17 @@ def resize_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[None]: - """Update the size of a volume. + ) -> ApiResponse[Backup]: + """Update information of a backup. - Update the size of a block device volume. The new volume size must be larger than the current size. + Update name or labels of the backup. - :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 resize_volume_payload: Request a volume resize. - :type resize_volume_payload: ResizeVolumePayload + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_id: str + :param update_backup_payload: Request an update of a backup. (required) + :type update_backup_payload: UpdateBackupPayload :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 @@ -21850,10 +30458,10 @@ def resize_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._resize_volume_serialize( + _param = self._update_backup_serialize( project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, + backup_id=backup_id, + update_backup_payload=update_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21861,12 +30469,11 @@ def resize_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Backup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -21877,19 +30484,17 @@ def resize_volume_with_http_info( ) @validate_call - def resize_volume_without_preload_content( + def update_backup_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[ + backup_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 Backup."), ], - resize_volume_payload: Annotated[ - Optional[ResizeVolumePayload], Field(description="Request a volume resize.") - ] = None, + update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21900,16 +30505,16 @@ def resize_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update the size of a volume. + """Update information of a backup. - Update the size of a block device volume. The new volume size must be larger than the current size. + Update name or labels of the backup. :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 resize_volume_payload: Request a volume resize. - :type resize_volume_payload: ResizeVolumePayload + :param backup_id: The identifier (ID) of a STACKIT Backup. (required) + :type backup_id: str + :param update_backup_payload: Request an update of a backup. (required) + :type update_backup_payload: UpdateBackupPayload :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 @@ -21932,10 +30537,10 @@ def resize_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._resize_volume_serialize( + _param = self._update_backup_serialize( project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, + backup_id=backup_id, + update_backup_payload=update_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21943,22 +30548,21 @@ def resize_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Backup", "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 _resize_volume_serialize( + def _update_backup_serialize( self, project_id, - volume_id, - resize_volume_payload, + backup_id, + update_backup_payload, _request_auth, _content_type, _headers, @@ -21979,14 +30583,14 @@ def _resize_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 backup_id is not None: + _path_params["backupId"] = backup_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if resize_volume_payload is not None: - _body_params = resize_volume_payload + if update_backup_payload is not None: + _body_params = update_backup_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -22004,8 +30608,8 @@ def _resize_volume_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1beta1/projects/{projectId}/volumes/{volumeId}/resize", + method="PATCH", + resource_path="/v1beta1/projects/{projectId}/backups/{backupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -22019,16 +30623,16 @@ def _resize_volume_serialize( ) @validate_call - def start_server( + 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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + 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)], @@ -22038,15 +30642,17 @@ def start_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Boot up a server. + ) -> Image: + """Update Image Parameters. - Start an existing server or allocates the server if deallocated. + 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 server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_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 @@ -22069,9 +30675,10 @@ def start_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._start_server_serialize( + _param = self._update_image_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, + update_image_payload=update_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22079,12 +30686,11 @@ def start_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -22095,16 +30701,16 @@ def start_server( ).data @validate_call - def start_server_with_http_info( + 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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + 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)], @@ -22114,15 +30720,17 @@ def start_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[None]: - """Boot up a server. + ) -> ApiResponse[Image]: + """Update Image Parameters. - Start an existing server or allocates the server if deallocated. + 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 server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_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 @@ -22145,9 +30753,10 @@ def start_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._start_server_serialize( + _param = self._update_image_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, + update_image_payload=update_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22155,12 +30764,11 @@ def start_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -22171,16 +30779,16 @@ def start_server_with_http_info( ) @validate_call - def start_server_without_preload_content( + 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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + 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)], @@ -22191,14 +30799,16 @@ def start_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Boot up a server. + """Update Image Parameters. - Start an existing server or allocates the server if deallocated. + 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 server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_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 @@ -22221,9 +30831,10 @@ def start_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._start_server_serialize( + _param = self._update_image_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, + update_image_payload=update_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22231,21 +30842,21 @@ def start_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "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 _start_server_serialize( + def _update_image_serialize( self, project_id, - server_id, + image_id, + update_image_payload, _request_auth, _content_type, _headers, @@ -22266,23 +30877,33 @@ def _start_server_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 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="POST", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/start", + method="PATCH", + resource_path="/v1beta1/projects/{projectId}/images/{imageId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -22296,15 +30917,14 @@ def _start_server_serialize( ) @validate_call - def stop_server( + def update_image_scope_local( 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."), + 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, @@ -22315,15 +30935,15 @@ def stop_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Stop an existing server. + ) -> Image: + """Update Image Scope to Local. - Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + Update the scope property of an existing Image inside a project to local. :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 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 @@ -22346,9 +30966,9 @@ def stop_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._stop_server_serialize( + _param = self._update_image_scope_local_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22356,12 +30976,11 @@ def stop_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -22372,15 +30991,14 @@ def stop_server( ).data @validate_call - def stop_server_with_http_info( + def update_image_scope_local_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."), + 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, @@ -22391,15 +31009,15 @@ def stop_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[None]: - """Stop an existing server. + ) -> ApiResponse[Image]: + """Update Image Scope to Local. - Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + Update the scope property of an existing Image inside a project to local. :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 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 @@ -22422,9 +31040,9 @@ def stop_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._stop_server_serialize( + _param = self._update_image_scope_local_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22432,12 +31050,11 @@ def stop_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -22448,15 +31065,14 @@ def stop_server_with_http_info( ) @validate_call - def stop_server_without_preload_content( + def update_image_scope_local_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."), + 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, @@ -22468,14 +31084,14 @@ def stop_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Stop an existing server. + """Update Image Scope to Local. - Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + Update the scope property of an existing Image inside a project to local. :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 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 @@ -22498,9 +31114,9 @@ def stop_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._stop_server_serialize( + _param = self._update_image_scope_local_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22508,21 +31124,20 @@ def stop_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "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 _stop_server_serialize( + def _update_image_scope_local_serialize( self, project_id, - server_id, + image_id, _request_auth, _content_type, _headers, @@ -22543,8 +31158,8 @@ def _stop_server_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 image_id is not None: + _path_params["imageId"] = image_id # process the query parameters # process the header parameters # process the form parameters @@ -22558,8 +31173,8 @@ def _stop_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/stop", + method="DELETE", + resource_path="/v1beta1/projects/{projectId}/images/{imageId}/publish", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -22573,15 +31188,14 @@ def _stop_server_serialize( ) @validate_call - def unrescue_server( + def update_image_scope_public( 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."), + 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, @@ -22592,15 +31206,15 @@ def unrescue_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Unrescue an existing server. + ) -> Image: + """Update Image Scope to Public. - Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + Update the scope property of an existing Image inside a project to public. :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 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 @@ -22623,9 +31237,9 @@ def unrescue_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._unrescue_server_serialize( + _param = self._update_image_scope_public_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22633,12 +31247,11 @@ def unrescue_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -22649,15 +31262,14 @@ def unrescue_server( ).data @validate_call - def unrescue_server_with_http_info( + def update_image_scope_public_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."), + 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, @@ -22668,15 +31280,15 @@ def unrescue_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[None]: - """Unrescue an existing server. + ) -> ApiResponse[Image]: + """Update Image Scope to Public. - Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + Update the scope property of an existing Image inside a project to public. :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 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 @@ -22699,9 +31311,9 @@ def unrescue_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._unrescue_server_serialize( + _param = self._update_image_scope_public_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22709,12 +31321,11 @@ def unrescue_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -22725,15 +31336,14 @@ def unrescue_server_with_http_info( ) @validate_call - def unrescue_server_without_preload_content( + def update_image_scope_public_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."), + 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, @@ -22745,14 +31355,14 @@ def unrescue_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Unrescue an existing server. + """Update Image Scope to Public. - Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + Update the scope property of an existing Image inside a project to public. :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 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 @@ -22775,9 +31385,9 @@ def unrescue_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._unrescue_server_serialize( + _param = self._update_image_scope_public_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22785,21 +31395,20 @@ def unrescue_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Image", "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 _unrescue_server_serialize( + def _update_image_scope_public_serialize( self, project_id, - server_id, + image_id, _request_auth, _content_type, _headers, @@ -22820,8 +31429,8 @@ def _unrescue_server_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 image_id is not None: + _path_params["imageId"] = image_id # process the query parameters # process the header parameters # process the form parameters @@ -22835,8 +31444,8 @@ def _unrescue_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/unrescue", + method="PUT", + resource_path="/v1beta1/projects/{projectId}/images/{imageId}/publish", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -22850,23 +31459,16 @@ def _unrescue_server_serialize( ) @validate_call - def update_attached_volume( + def update_image_share( 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."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - update_attached_volume_payload: Annotated[ - UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], + update_image_share_payload: Annotated[UpdateImageSharePayload, Field(description="Update an Image Share.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -22876,19 +31478,17 @@ def update_attached_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeAttachment: - """Update Volume Attachment Parameters. + ) -> ImageShare: + """Update image share. - Update the properties of an existing Volume Attachment. + Update share of an Image. Projects will be appended to existing list. :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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param update_attached_volume_payload: Request a volume attachment update. (required) - :type update_attached_volume_payload: UpdateAttachedVolumePayload + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param update_image_share_payload: Update an Image Share. (required) + :type update_image_share_payload: UpdateImageSharePayload :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 @@ -22911,11 +31511,10 @@ def update_attached_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_attached_volume_serialize( + _param = self._update_image_share_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, + image_id=image_id, + update_image_share_payload=update_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22923,7 +31522,7 @@ def update_attached_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "ImageShare", "400": "Error", "401": "Error", "403": "Error", @@ -22938,23 +31537,16 @@ def update_attached_volume( ).data @validate_call - def update_attached_volume_with_http_info( + def update_image_share_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."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - update_attached_volume_payload: Annotated[ - UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], + update_image_share_payload: Annotated[UpdateImageSharePayload, Field(description="Update an Image Share.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -22964,19 +31556,17 @@ def update_attached_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[VolumeAttachment]: - """Update Volume Attachment Parameters. + ) -> ApiResponse[ImageShare]: + """Update image share. - Update the properties of an existing Volume Attachment. + Update share of an Image. Projects will be appended to existing list. :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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param update_attached_volume_payload: Request a volume attachment update. (required) - :type update_attached_volume_payload: UpdateAttachedVolumePayload + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param update_image_share_payload: Update an Image Share. (required) + :type update_image_share_payload: UpdateImageSharePayload :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 @@ -22999,11 +31589,10 @@ def update_attached_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_attached_volume_serialize( + _param = self._update_image_share_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, + image_id=image_id, + update_image_share_payload=update_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23011,7 +31600,7 @@ def update_attached_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "ImageShare", "400": "Error", "401": "Error", "403": "Error", @@ -23026,23 +31615,16 @@ def update_attached_volume_with_http_info( ) @validate_call - def update_attached_volume_without_preload_content( + def update_image_share_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."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - update_attached_volume_payload: Annotated[ - UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], + update_image_share_payload: Annotated[UpdateImageSharePayload, Field(description="Update an Image Share.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -23053,18 +31635,16 @@ def update_attached_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Volume Attachment Parameters. + """Update image share. - Update the properties of an existing Volume Attachment. + Update share of an Image. Projects will be appended to existing list. :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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param update_attached_volume_payload: Request a volume attachment update. (required) - :type update_attached_volume_payload: UpdateAttachedVolumePayload + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param update_image_share_payload: Update an Image Share. (required) + :type update_image_share_payload: UpdateImageSharePayload :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 @@ -23087,11 +31667,10 @@ def update_attached_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_attached_volume_serialize( + _param = self._update_image_share_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, + image_id=image_id, + update_image_share_payload=update_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23099,7 +31678,7 @@ def update_attached_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "ImageShare", "400": "Error", "401": "Error", "403": "Error", @@ -23109,12 +31688,11 @@ def update_attached_volume_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_attached_volume_serialize( + def _update_image_share_serialize( self, - project_id, - server_id, - volume_id, - update_attached_volume_payload, + project_id, + image_id, + update_image_share_payload, _request_auth, _content_type, _headers, @@ -23135,16 +31713,14 @@ def _update_attached_volume_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 + 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_attached_volume_payload is not None: - _body_params = update_attached_volume_payload + if update_image_share_payload is not None: + _body_params = update_image_share_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -23163,7 +31739,7 @@ def _update_attached_volume_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", + resource_path="/v1beta1/projects/{projectId}/images/{imageId}/share", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -25021,6 +33597,309 @@ def _update_server_serialize( _request_auth=_request_auth, ) + @validate_call + def update_snapshot( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], + update_snapshot_payload: Annotated[ + UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") + ], + _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, + ) -> Snapshot: + """Update information of the snapshot. + + Update information like name or labels of the snapshot. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_id: str + :param update_snapshot_payload: Request an update of a snapshot. (required) + :type update_snapshot_payload: UpdateSnapshotPayload + :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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_id, + update_snapshot_payload=update_snapshot_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Snapshot", + "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_snapshot_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."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], + update_snapshot_payload: Annotated[ + UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") + ], + _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[Snapshot]: + """Update information of the snapshot. + + Update information like name or labels of the snapshot. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_id: str + :param update_snapshot_payload: Request an update of a snapshot. (required) + :type update_snapshot_payload: UpdateSnapshotPayload + :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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_id, + update_snapshot_payload=update_snapshot_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Snapshot", + "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_snapshot_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."), + ], + snapshot_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), + ], + update_snapshot_payload: Annotated[ + UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") + ], + _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 information of the snapshot. + + Update information like name or labels of the snapshot. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) + :type snapshot_id: str + :param update_snapshot_payload: Request an update of a snapshot. (required) + :type update_snapshot_payload: UpdateSnapshotPayload + :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_snapshot_serialize( + project_id=project_id, + snapshot_id=snapshot_id, + update_snapshot_payload=update_snapshot_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Snapshot", + "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_snapshot_serialize( + self, + project_id, + snapshot_id, + update_snapshot_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 snapshot_id is not None: + _path_params["snapshotId"] = snapshot_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_snapshot_payload is not None: + _body_params = update_snapshot_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="/v1beta1/projects/{projectId}/snapshots/{snapshotId}", + 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_volume( self, diff --git a/services/iaas/src/stackit/iaas/models/__init__.py b/services/iaas/src/stackit/iaas/models/__init__.py index 6ea46fab..22b9c3b7 100644 --- a/services/iaas/src/stackit/iaas/models/__init__.py +++ b/services/iaas/src/stackit/iaas/models/__init__.py @@ -16,15 +16,26 @@ # import models into model package from stackit.iaas.models.add_volume_to_server_payload import AddVolumeToServerPayload +from stackit.iaas.models.affinity_group import AffinityGroup +from stackit.iaas.models.affinity_group_list_response import AffinityGroupListResponse from stackit.iaas.models.allowed_addresses_inner import AllowedAddressesInner from stackit.iaas.models.area import Area from stackit.iaas.models.area_config import AreaConfig from stackit.iaas.models.area_prefix_config_ipv4 import AreaPrefixConfigIPv4 +from stackit.iaas.models.availability_zone_list_response import ( + AvailabilityZoneListResponse, +) +from stackit.iaas.models.backup import Backup +from stackit.iaas.models.backup_list_response import BackupListResponse +from stackit.iaas.models.backup_source import BackupSource from stackit.iaas.models.base_security_group_rule import BaseSecurityGroupRule from stackit.iaas.models.boot_volume import BootVolume from stackit.iaas.models.boot_volume_source import BootVolumeSource +from stackit.iaas.models.create_affinity_group_payload import CreateAffinityGroupPayload from stackit.iaas.models.create_area_address_family import CreateAreaAddressFamily from stackit.iaas.models.create_area_ipv4 import CreateAreaIPv4 +from stackit.iaas.models.create_backup_payload import CreateBackupPayload +from stackit.iaas.models.create_image_payload import CreateImagePayload from stackit.iaas.models.create_key_pair_payload import CreateKeyPairPayload from stackit.iaas.models.create_network_address_family import CreateNetworkAddressFamily from stackit.iaas.models.create_network_area_payload import CreateNetworkAreaPayload @@ -55,11 +66,18 @@ from stackit.iaas.models.create_server_payload_networking import ( CreateServerPayloadNetworking, ) +from stackit.iaas.models.create_snapshot_payload import CreateSnapshotPayload from stackit.iaas.models.create_volume_payload import CreateVolumePayload from stackit.iaas.models.error import Error from stackit.iaas.models.get_server_log200_response import GetServerLog200Response -from stackit.iaas.models.get_server_log_request import GetServerLogRequest from stackit.iaas.models.icmp_parameters import ICMPParameters +from stackit.iaas.models.image import Image +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_list_response import ImageListResponse +from stackit.iaas.models.image_share import ImageShare +from stackit.iaas.models.image_share_consumer import ImageShareConsumer from stackit.iaas.models.key_pair_list_response import KeyPairListResponse from stackit.iaas.models.keypair import Keypair from stackit.iaas.models.machine_type import MachineType @@ -84,6 +102,9 @@ from stackit.iaas.models.protocol import Protocol from stackit.iaas.models.public_ip import PublicIp from stackit.iaas.models.public_ip_list_response import PublicIpListResponse +from stackit.iaas.models.quota import Quota +from stackit.iaas.models.quota_list import QuotaList +from stackit.iaas.models.quota_list_response import QuotaListResponse from stackit.iaas.models.request import Request from stackit.iaas.models.request_resource import RequestResource from stackit.iaas.models.rescue_server_payload import RescueServerPayload @@ -106,11 +127,17 @@ from stackit.iaas.models.service_account_mail_list_response import ( ServiceAccountMailListResponse, ) +from stackit.iaas.models.set_image_share_payload import SetImageSharePayload +from stackit.iaas.models.snapshot import Snapshot +from stackit.iaas.models.snapshot_list_response import SnapshotListResponse from stackit.iaas.models.update_area_address_family import UpdateAreaAddressFamily from stackit.iaas.models.update_area_ipv4 import UpdateAreaIPv4 from stackit.iaas.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaas.models.update_backup_payload import UpdateBackupPayload +from stackit.iaas.models.update_image_payload import UpdateImagePayload +from stackit.iaas.models.update_image_share_payload import UpdateImageSharePayload from stackit.iaas.models.update_key_pair_payload import UpdateKeyPairPayload from stackit.iaas.models.update_network_address_family import UpdateNetworkAddressFamily from stackit.iaas.models.update_network_area_route_payload import ( @@ -122,6 +149,7 @@ from stackit.iaas.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaas.models.update_security_group_payload import UpdateSecurityGroupPayload from stackit.iaas.models.update_server_payload import UpdateServerPayload +from stackit.iaas.models.update_snapshot_payload import UpdateSnapshotPayload from stackit.iaas.models.update_volume_payload import UpdateVolumePayload from stackit.iaas.models.volume import Volume from stackit.iaas.models.volume_attachment import VolumeAttachment diff --git a/services/iaas/src/stackit/iaas/models/affinity_group.py b/services/iaas/src/stackit/iaas/models/affinity_group.py new file mode 100644 index 00000000..86807607 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/affinity_group.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class AffinityGroup(BaseModel): + """ + Definition of an affinity group. + """ + + id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID)." + ) + members: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( + default=None, description="The servers that are part of the affinity group." + ) + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + policy: StrictStr = Field(description="The affinity group policy.") + __properties: ClassVar[List[str]] = ["id", "members", "name", "policy"] + + @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 AffinityGroup 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. + """ + excluded_fields: Set[str] = set( + [ + "id", + "members", + ] + ) + + _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 AffinityGroup 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"), "members": obj.get("members"), "name": obj.get("name"), "policy": obj.get("policy")} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/affinity_group_list_response.py b/services/iaas/src/stackit/iaas/models/affinity_group_list_response.py new file mode 100644 index 00000000..830f5aff --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/affinity_group_list_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaas.models.affinity_group import AffinityGroup + + +class AffinityGroupListResponse(BaseModel): + """ + Response object for affinity group list request. + """ + + items: List[AffinityGroup] = Field(description="A list of affinity groups.") + __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 AffinityGroupListResponse 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 AffinityGroupListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "items": ( + [AffinityGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ) + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/get_server_log_request.py b/services/iaas/src/stackit/iaas/models/availability_zone_list_response.py similarity index 76% rename from services/iaas/src/stackit/iaas/models/get_server_log_request.py rename to services/iaas/src/stackit/iaas/models/availability_zone_list_response.py index 4caab6b0..00a1c391 100644 --- a/services/iaas/src/stackit/iaas/models/get_server_log_request.py +++ b/services/iaas/src/stackit/iaas/models/availability_zone_list_response.py @@ -18,19 +18,17 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self -class GetServerLogRequest(BaseModel): +class AvailabilityZoneListResponse(BaseModel): """ - GetServerLogRequest + Availability Zone list response. """ - length: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( - default=2000, description="Set to 0 to retrieve the complete log." - ) - __properties: ClassVar[List[str]] = ["length"] + items: List[StrictStr] = Field(description="A list of availability zones.") + __properties: ClassVar[List[str]] = ["items"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GetServerLogRequest from a JSON string""" + """Create an instance of AvailabilityZoneListResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,12 +71,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GetServerLogRequest from a dict""" + """Create an instance of AvailabilityZoneListResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"length": obj.get("length") if obj.get("length") is not None else 2000}) + _obj = cls.model_validate({"items": obj.get("items")}) return _obj diff --git a/services/iaas/src/stackit/iaas/models/backup.py b/services/iaas/src/stackit/iaas/models/backup.py new file mode 100644 index 00000000..0a3e8719 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/backup.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class Backup(BaseModel): + """ + Object that represents a backup. + """ + + availability_zone: Optional[StrictStr] = Field( + default=None, description="Object that represents an availability zone.", alias="availabilityZone" + ) + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) + 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." + ) + name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( + default=None, description="The name for a General Object. Matches Names and also UUIDs." + ) + size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") + snapshot_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="snapshotId" + ) + status: Optional[StrictStr] = Field(default=None, description="The status of a backup object.") + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + volume_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="volumeId" + ) + __properties: ClassVar[List[str]] = [ + "availabilityZone", + "createdAt", + "id", + "labels", + "name", + "size", + "snapshotId", + "status", + "updatedAt", + "volumeId", + ] + + @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 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 + + @field_validator("snapshot_id") + def snapshot_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("volume_id") + def volume_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 + + 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 Backup 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. + * 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( + [ + "availability_zone", + "created_at", + "id", + "size", + "snapshot_id", + "status", + "updated_at", + "volume_id", + ] + ) + + _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 Backup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "availabilityZone": obj.get("availabilityZone"), + "createdAt": obj.get("createdAt"), + "id": obj.get("id"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "size": obj.get("size"), + "snapshotId": obj.get("snapshotId"), + "status": obj.get("status"), + "updatedAt": obj.get("updatedAt"), + "volumeId": obj.get("volumeId"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/backup_list_response.py b/services/iaas/src/stackit/iaas/models/backup_list_response.py new file mode 100644 index 00000000..59780cbd --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/backup_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: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaas.models.backup import Backup + + +class BackupListResponse(BaseModel): + """ + Backup list response. + """ + + items: List[Backup] = Field(description="A list containing backup 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 BackupListResponse 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 BackupListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"items": [Backup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/backup_source.py b/services/iaas/src/stackit/iaas/models/backup_source.py new file mode 100644 index 00000000..1c1f86fd --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/backup_source.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class BackupSource(BaseModel): + """ + The source object of a backup. + """ + + id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="Universally Unique Identifier (UUID)." + ) + type: StrictStr = Field(description="The source types of a backup.") + __properties: ClassVar[List[str]] = ["id", "type"] + + @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 BackupSource 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 BackupSource 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"), "type": obj.get("type")}) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/create_affinity_group_payload.py b/services/iaas/src/stackit/iaas/models/create_affinity_group_payload.py new file mode 100644 index 00000000..c067ce72 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/create_affinity_group_payload.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class CreateAffinityGroupPayload(BaseModel): + """ + Definition of an affinity group. + """ + + id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID)." + ) + members: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( + default=None, description="The servers that are part of the affinity group." + ) + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + policy: StrictStr = Field(description="The affinity group policy.") + __properties: ClassVar[List[str]] = ["id", "members", "name", "policy"] + + @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 CreateAffinityGroupPayload 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. + """ + excluded_fields: Set[str] = set( + [ + "id", + "members", + ] + ) + + _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 CreateAffinityGroupPayload 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"), "members": obj.get("members"), "name": obj.get("name"), "policy": obj.get("policy")} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/create_backup_payload.py b/services/iaas/src/stackit/iaas/models/create_backup_payload.py new file mode 100644 index 00000000..734f6962 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/create_backup_payload.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + +from stackit.iaas.models.backup_source import BackupSource + + +class CreateBackupPayload(BaseModel): + """ + Object that represents a backup create request body. + """ + + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + 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." + ) + source: BackupSource + __properties: ClassVar[List[str]] = ["labels", "name", "source"] + + @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 CreateBackupPayload 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 source + if self.source: + _dict["source"] = self.source.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateBackupPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "labels": obj.get("labels"), + "name": obj.get("name"), + "source": BackupSource.from_dict(obj["source"]) if obj.get("source") is not None else None, + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/create_image_payload.py b/services/iaas/src/stackit/iaas/models/create_image_payload.py new file mode 100644 index 00000000..1cd178d4 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/create_image_payload.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from 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.iaas.models.image_checksum import ImageChecksum +from stackit.iaas.models.image_config import ImageConfig + + +class CreateImagePayload(BaseModel): + """ + Object that represents an Image and its parameters. Used for Creating and returning (get/list). + """ + + checksum: Optional[ImageChecksum] = None + 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." + ) + owner: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID)." + ) + protected: Optional[StrictBool] = None + scope: Optional[StrictStr] = Field(default=None, description="Scope of an Image.") + status: Optional[StrictStr] = Field(default=None, description="The status of an image object.") + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + __properties: ClassVar[List[str]] = [ + "checksum", + "config", + "createdAt", + "diskFormat", + "id", + "labels", + "minDiskSize", + "minRam", + "name", + "owner", + "protected", + "scope", + "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 + + @field_validator("owner") + def owner_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 + + 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "checksum", + "created_at", + "id", + "owner", + "scope", + "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 checksum + if self.checksum: + _dict["checksum"] = self.checksum.to_dict() + # 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( + { + "checksum": ImageChecksum.from_dict(obj["checksum"]) if obj.get("checksum") is not None else None, + "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"), + "owner": obj.get("owner"), + "protected": obj.get("protected"), + "scope": obj.get("scope"), + "status": obj.get("status"), + "updatedAt": obj.get("updatedAt"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py b/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py new file mode 100644 index 00000000..19ff3de0 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/create_snapshot_payload.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class CreateSnapshotPayload(BaseModel): + """ + Object that represents a snapshot. + """ + + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) + 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." + ) + name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( + default=None, description="The name for a General Object. Matches Names and also UUIDs." + ) + size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") + status: Optional[StrictStr] = Field(default=None, description="The status of a snapshot object.") + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + volume_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="Universally Unique Identifier (UUID).", alias="volumeId" + ) + __properties: ClassVar[List[str]] = ["createdAt", "id", "labels", "name", "size", "status", "updatedAt", "volumeId"] + + @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 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 + + @field_validator("volume_id") + def volume_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 CreateSnapshotPayload 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. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "created_at", + "id", + "size", + "status", + "updated_at", + ] + ) + + _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 CreateSnapshotPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "createdAt": obj.get("createdAt"), + "id": obj.get("id"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "size": obj.get("size"), + "status": obj.get("status"), + "updatedAt": obj.get("updatedAt"), + "volumeId": obj.get("volumeId"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/create_volume_payload.py b/services/iaas/src/stackit/iaas/models/create_volume_payload.py index d5075398..d7ed3e7d 100644 --- a/services/iaas/src/stackit/iaas/models/create_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/create_volume_payload.py @@ -31,6 +31,7 @@ ) from typing_extensions import Annotated, Self +from stackit.iaas.models.image_config import ImageConfig from stackit.iaas.models.volume_source import VolumeSource @@ -52,6 +53,7 @@ class CreateVolumePayload(BaseModel): id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) + image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( default=None, description="Object that represents the labels of an object." ) @@ -78,6 +80,7 @@ class CreateVolumePayload(BaseModel): "createdAt", "description", "id", + "imageConfig", "labels", "name", "performanceClass", @@ -166,11 +169,13 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ "created_at", "id", + "image_config", "server_id", "status", "updated_at", @@ -182,6 +187,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of image_config + if self.image_config: + _dict["imageConfig"] = self.image_config.to_dict() # override the default output from pydantic by calling `to_dict()` of source if self.source: _dict["source"] = self.source.to_dict() @@ -203,6 +211,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "createdAt": obj.get("createdAt"), "description": obj.get("description"), "id": obj.get("id"), + "imageConfig": ( + ImageConfig.from_dict(obj["imageConfig"]) if obj.get("imageConfig") is not None else None + ), "labels": obj.get("labels"), "name": obj.get("name"), "performanceClass": obj.get("performanceClass"), diff --git a/services/iaas/src/stackit/iaas/models/image.py b/services/iaas/src/stackit/iaas/models/image.py new file mode 100644 index 00000000..b9ab3131 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/image.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from 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.iaas.models.image_checksum import ImageChecksum +from stackit.iaas.models.image_config import ImageConfig + + +class Image(BaseModel): + """ + Object that represents an Image and its parameters. Used for Creating and returning (get/list). + """ + + checksum: Optional[ImageChecksum] = None + 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." + ) + owner: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID)." + ) + protected: Optional[StrictBool] = None + scope: Optional[StrictStr] = Field(default=None, description="Scope of an Image.") + status: Optional[StrictStr] = Field(default=None, description="The status of an image object.") + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + __properties: ClassVar[List[str]] = [ + "checksum", + "config", + "createdAt", + "diskFormat", + "id", + "labels", + "minDiskSize", + "minRam", + "name", + "owner", + "protected", + "scope", + "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 + + @field_validator("owner") + def owner_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 + + 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "checksum", + "created_at", + "id", + "owner", + "scope", + "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 checksum + if self.checksum: + _dict["checksum"] = self.checksum.to_dict() + # 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( + { + "checksum": ImageChecksum.from_dict(obj["checksum"]) if obj.get("checksum") is not None else None, + "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"), + "owner": obj.get("owner"), + "protected": obj.get("protected"), + "scope": obj.get("scope"), + "status": obj.get("status"), + "updatedAt": obj.get("updatedAt"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/image_checksum.py b/services/iaas/src/stackit/iaas/models/image_checksum.py new file mode 100644 index 00000000..687e96ce --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/image_checksum.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class ImageChecksum(BaseModel): + """ + Representation of an image checksum. + """ + + algorithm: StrictStr = Field(description="Algorithm for the checksum of the image data.") + digest: Annotated[str, Field(strict=True)] = Field(description="Hexdigest of the checksum of the image data.") + __properties: ClassVar[List[str]] = ["algorithm", "digest"] + + @field_validator("digest") + def digest_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-f]+$", value): + raise ValueError(r"must validate the regular expression /^[0-9a-f]+$/") + 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 ImageChecksum 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 ImageChecksum from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"algorithm": obj.get("algorithm"), "digest": obj.get("digest")}) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/image_config.py b/services/iaas/src/stackit/iaas/models/image_config.py new file mode 100644 index 00000000..e3914bdb --- /dev/null +++ b/services/iaas/src/stackit/iaas/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: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, 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/iaas/src/stackit/iaas/models/image_create_response.py b/services/iaas/src/stackit/iaas/models/image_create_response.py new file mode 100644 index 00000000..6280a634 --- /dev/null +++ b/services/iaas/src/stackit/iaas/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: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, 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/iaas/src/stackit/iaas/models/image_list_response.py b/services/iaas/src/stackit/iaas/models/image_list_response.py new file mode 100644 index 00000000..a845ef7f --- /dev/null +++ b/services/iaas/src/stackit/iaas/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: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaas.models.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/iaas/src/stackit/iaas/models/image_share.py b/services/iaas/src/stackit/iaas/models/image_share.py new file mode 100644 index 00000000..00cf4242 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/image_share.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing_extensions import Annotated, Self + + +class ImageShare(BaseModel): + """ + Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. + """ + + parent_organization: Optional[StrictBool] = Field( + default=None, + description="Image is shared with all projects inside the image owners organization.", + alias="parentOrganization", + ) + projects: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( + default=None, description="List of all projects the Image is shared with." + ) + __properties: ClassVar[List[str]] = ["parentOrganization", "projects"] + + 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 ImageShare 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 ImageShare from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"parentOrganization": obj.get("parentOrganization"), "projects": obj.get("projects")} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/image_share_consumer.py b/services/iaas/src/stackit/iaas/models/image_share_consumer.py new file mode 100644 index 00000000..a23b16ad --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/image_share_consumer.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class ImageShareConsumer(BaseModel): + """ + The details of an Image share consumer. + """ + + consumer_project_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="consumerProjectId" + ) + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) + image_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="imageId" + ) + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + __properties: ClassVar[List[str]] = ["consumerProjectId", "createdAt", "imageId", "updatedAt"] + + @field_validator("consumer_project_id") + def consumer_project_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("image_id") + def image_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 + + 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 ImageShareConsumer 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( + [ + "consumer_project_id", + "created_at", + "image_id", + "updated_at", + ] + ) + + _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 ImageShareConsumer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "consumerProjectId": obj.get("consumerProjectId"), + "createdAt": obj.get("createdAt"), + "imageId": obj.get("imageId"), + "updatedAt": obj.get("updatedAt"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/quota.py b/services/iaas/src/stackit/iaas/models/quota.py new file mode 100644 index 00000000..1c1b5653 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/quota.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing_extensions import Self + + +class Quota(BaseModel): + """ + Object that represents a single resource quota. + """ + + limit: StrictInt + usage: StrictInt + __properties: ClassVar[List[str]] = ["limit", "usage"] + + 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 Quota 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 Quota from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"limit": obj.get("limit"), "usage": obj.get("usage")}) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/quota_list.py b/services/iaas/src/stackit/iaas/models/quota_list.py new file mode 100644 index 00000000..20449c79 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/quota_list.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaas.models.quota import Quota + + +class QuotaList(BaseModel): + """ + Object that represents the quotas for a project. + """ + + backup_gigabytes: Quota = Field(description="Total size in GiB of backups.", alias="backupGigabytes") + backups: Quota = Field(description="Number of backups.") + gigabytes: Quota = Field(description="Total size in GiB of volumes and snapshots.") + networks: Quota = Field(description="Number of networks.") + nics: Quota = Field(description="Number of network interfaces.") + public_ips: Quota = Field(description="Number of public IP addresses.", alias="publicIps") + ram: Quota = Field(description="Amount of server RAM in MiB.") + security_group_rules: Quota = Field(description="Number of security group rules.", alias="securityGroupRules") + security_groups: Quota = Field(description="Number of security groups.", alias="securityGroups") + snapshots: Quota = Field(description="Number of snapshots.") + vcpu: Quota = Field(description="Number of server cores.") + volumes: Quota = Field(description="Number of volumes.") + __properties: ClassVar[List[str]] = [ + "backupGigabytes", + "backups", + "gigabytes", + "networks", + "nics", + "publicIps", + "ram", + "securityGroupRules", + "securityGroups", + "snapshots", + "vcpu", + "volumes", + ] + + 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 QuotaList 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 backup_gigabytes + if self.backup_gigabytes: + _dict["backupGigabytes"] = self.backup_gigabytes.to_dict() + # override the default output from pydantic by calling `to_dict()` of backups + if self.backups: + _dict["backups"] = self.backups.to_dict() + # override the default output from pydantic by calling `to_dict()` of gigabytes + if self.gigabytes: + _dict["gigabytes"] = self.gigabytes.to_dict() + # override the default output from pydantic by calling `to_dict()` of networks + if self.networks: + _dict["networks"] = self.networks.to_dict() + # override the default output from pydantic by calling `to_dict()` of nics + if self.nics: + _dict["nics"] = self.nics.to_dict() + # override the default output from pydantic by calling `to_dict()` of public_ips + if self.public_ips: + _dict["publicIps"] = self.public_ips.to_dict() + # override the default output from pydantic by calling `to_dict()` of ram + if self.ram: + _dict["ram"] = self.ram.to_dict() + # override the default output from pydantic by calling `to_dict()` of security_group_rules + if self.security_group_rules: + _dict["securityGroupRules"] = self.security_group_rules.to_dict() + # override the default output from pydantic by calling `to_dict()` of security_groups + if self.security_groups: + _dict["securityGroups"] = self.security_groups.to_dict() + # override the default output from pydantic by calling `to_dict()` of snapshots + if self.snapshots: + _dict["snapshots"] = self.snapshots.to_dict() + # override the default output from pydantic by calling `to_dict()` of vcpu + if self.vcpu: + _dict["vcpu"] = self.vcpu.to_dict() + # override the default output from pydantic by calling `to_dict()` of volumes + if self.volumes: + _dict["volumes"] = self.volumes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of QuotaList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "backupGigabytes": ( + Quota.from_dict(obj["backupGigabytes"]) if obj.get("backupGigabytes") is not None else None + ), + "backups": Quota.from_dict(obj["backups"]) if obj.get("backups") is not None else None, + "gigabytes": Quota.from_dict(obj["gigabytes"]) if obj.get("gigabytes") is not None else None, + "networks": Quota.from_dict(obj["networks"]) if obj.get("networks") is not None else None, + "nics": Quota.from_dict(obj["nics"]) if obj.get("nics") is not None else None, + "publicIps": Quota.from_dict(obj["publicIps"]) if obj.get("publicIps") is not None else None, + "ram": Quota.from_dict(obj["ram"]) if obj.get("ram") is not None else None, + "securityGroupRules": ( + Quota.from_dict(obj["securityGroupRules"]) if obj.get("securityGroupRules") is not None else None + ), + "securityGroups": ( + Quota.from_dict(obj["securityGroups"]) if obj.get("securityGroups") is not None else None + ), + "snapshots": Quota.from_dict(obj["snapshots"]) if obj.get("snapshots") is not None else None, + "vcpu": Quota.from_dict(obj["vcpu"]) if obj.get("vcpu") is not None else None, + "volumes": Quota.from_dict(obj["volumes"]) if obj.get("volumes") is not None else None, + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/quota_list_response.py b/services/iaas/src/stackit/iaas/models/quota_list_response.py new file mode 100644 index 00000000..07279093 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/quota_list_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from typing_extensions import Self + +from stackit.iaas.models.quota_list import QuotaList + + +class QuotaListResponse(BaseModel): + """ + Quotas list response. + """ + + quotas: QuotaList + __properties: ClassVar[List[str]] = ["quotas"] + + 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 QuotaListResponse 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 quotas + if self.quotas: + _dict["quotas"] = self.quotas.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of QuotaListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"quotas": QuotaList.from_dict(obj["quotas"]) if obj.get("quotas") is not None else None} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/set_image_share_payload.py b/services/iaas/src/stackit/iaas/models/set_image_share_payload.py new file mode 100644 index 00000000..a05a2a86 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/set_image_share_payload.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing_extensions import Annotated, Self + + +class SetImageSharePayload(BaseModel): + """ + Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. + """ + + parent_organization: Optional[StrictBool] = Field( + default=None, + description="Image is shared with all projects inside the image owners organization.", + alias="parentOrganization", + ) + projects: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( + default=None, description="List of all projects the Image is shared with." + ) + __properties: ClassVar[List[str]] = ["parentOrganization", "projects"] + + 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 SetImageSharePayload 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 SetImageSharePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"parentOrganization": obj.get("parentOrganization"), "projects": obj.get("projects")} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/snapshot.py b/services/iaas/src/stackit/iaas/models/snapshot.py new file mode 100644 index 00000000..2c13cc7b --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/snapshot.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class Snapshot(BaseModel): + """ + Object that represents a snapshot. + """ + + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) + 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." + ) + name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( + default=None, description="The name for a General Object. Matches Names and also UUIDs." + ) + size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") + status: Optional[StrictStr] = Field(default=None, description="The status of a snapshot object.") + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + volume_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="Universally Unique Identifier (UUID).", alias="volumeId" + ) + __properties: ClassVar[List[str]] = ["createdAt", "id", "labels", "name", "size", "status", "updatedAt", "volumeId"] + + @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 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 + + @field_validator("volume_id") + def volume_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 Snapshot 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. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set( + [ + "created_at", + "id", + "size", + "status", + "updated_at", + ] + ) + + _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 Snapshot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "createdAt": obj.get("createdAt"), + "id": obj.get("id"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "size": obj.get("size"), + "status": obj.get("status"), + "updatedAt": obj.get("updatedAt"), + "volumeId": obj.get("volumeId"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/snapshot_list_response.py b/services/iaas/src/stackit/iaas/models/snapshot_list_response.py new file mode 100644 index 00000000..9f2be1db --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/snapshot_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: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaas.models.snapshot import Snapshot + + +class SnapshotListResponse(BaseModel): + """ + Snapshot list response. + """ + + items: List[Snapshot] = Field(description="A list containing snapshot 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 SnapshotListResponse 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 SnapshotListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"items": [Snapshot.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/update_backup_payload.py b/services/iaas/src/stackit/iaas/models/update_backup_payload.py new file mode 100644 index 00000000..40d22103 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/update_backup_payload.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class UpdateBackupPayload(BaseModel): + """ + Object that represents a backup. + """ + + availability_zone: Optional[StrictStr] = Field( + default=None, description="Object that represents an availability zone.", alias="availabilityZone" + ) + created_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was created.", alias="createdAt" + ) + 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." + ) + name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( + default=None, description="The name for a General Object. Matches Names and also UUIDs." + ) + size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") + snapshot_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="snapshotId" + ) + status: Optional[StrictStr] = Field(default=None, description="The status of a backup object.") + updated_at: Optional[datetime] = Field( + default=None, description="Date-time when resource was last updated.", alias="updatedAt" + ) + volume_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="volumeId" + ) + __properties: ClassVar[List[str]] = [ + "availabilityZone", + "createdAt", + "id", + "labels", + "name", + "size", + "snapshotId", + "status", + "updatedAt", + "volumeId", + ] + + @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 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 + + @field_validator("snapshot_id") + def snapshot_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("volume_id") + def volume_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 + + 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 UpdateBackupPayload 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. + * 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( + [ + "availability_zone", + "created_at", + "id", + "size", + "snapshot_id", + "status", + "updated_at", + "volume_id", + ] + ) + + _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 UpdateBackupPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "availabilityZone": obj.get("availabilityZone"), + "createdAt": obj.get("createdAt"), + "id": obj.get("id"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "size": obj.get("size"), + "snapshotId": obj.get("snapshotId"), + "status": obj.get("status"), + "updatedAt": obj.get("updatedAt"), + "volumeId": obj.get("volumeId"), + } + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/update_image_payload.py b/services/iaas/src/stackit/iaas/models/update_image_payload.py new file mode 100644 index 00000000..7e612777 --- /dev/null +++ b/services/iaas/src/stackit/iaas/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: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) +from typing_extensions import Annotated, Self + +from stackit.iaas.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/iaas/src/stackit/iaas/models/update_image_share_payload.py b/services/iaas/src/stackit/iaas/models/update_image_share_payload.py new file mode 100644 index 00000000..8d208a2c --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/update_image_share_payload.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing_extensions import Annotated, Self + + +class UpdateImageSharePayload(BaseModel): + """ + Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. + """ + + parent_organization: Optional[StrictBool] = Field( + default=None, + description="Image is shared with all projects inside the image owners organization.", + alias="parentOrganization", + ) + projects: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( + default=None, description="List of all projects the Image is shared with." + ) + __properties: ClassVar[List[str]] = ["parentOrganization", "projects"] + + 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 UpdateImageSharePayload 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 UpdateImageSharePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"parentOrganization": obj.get("parentOrganization"), "projects": obj.get("projects")} + ) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py b/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py new file mode 100644 index 00000000..ac9f2ac6 --- /dev/null +++ b/services/iaas/src/stackit/iaas/models/update_snapshot_payload.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1beta1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class UpdateSnapshotPayload(BaseModel): + """ + Object that represents an update request body of a snapshot. + """ + + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + 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]] = ["labels", "name"] + + @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 UpdateSnapshotPayload 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 UpdateSnapshotPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"labels": obj.get("labels"), "name": obj.get("name")}) + return _obj diff --git a/services/iaas/src/stackit/iaas/models/update_volume_payload.py b/services/iaas/src/stackit/iaas/models/update_volume_payload.py index 15b95e54..416c7f6d 100644 --- a/services/iaas/src/stackit/iaas/models/update_volume_payload.py +++ b/services/iaas/src/stackit/iaas/models/update_volume_payload.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator from typing_extensions import Annotated, Self +from stackit.iaas.models.image_config import ImageConfig + class UpdateVolumePayload(BaseModel): """ @@ -32,13 +34,14 @@ class UpdateVolumePayload(BaseModel): description: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="Description Object. Allows string up to 127 Characters." ) + image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( default=None, description="Object that represents the labels of an object." ) 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]] = ["bootable", "description", "labels", "name"] + __properties: ClassVar[List[str]] = ["bootable", "description", "imageConfig", "labels", "name"] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -87,6 +90,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of image_config + if self.image_config: + _dict["imageConfig"] = self.image_config.to_dict() return _dict @classmethod @@ -102,6 +108,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "bootable": obj.get("bootable") if obj.get("bootable") is not None else False, "description": obj.get("description"), + "imageConfig": ( + ImageConfig.from_dict(obj["imageConfig"]) if obj.get("imageConfig") is not None else None + ), "labels": obj.get("labels"), "name": obj.get("name"), } diff --git a/services/iaas/src/stackit/iaas/models/volume.py b/services/iaas/src/stackit/iaas/models/volume.py index 69b713d3..95c7881d 100644 --- a/services/iaas/src/stackit/iaas/models/volume.py +++ b/services/iaas/src/stackit/iaas/models/volume.py @@ -31,6 +31,7 @@ ) from typing_extensions import Annotated, Self +from stackit.iaas.models.image_config import ImageConfig from stackit.iaas.models.volume_source import VolumeSource @@ -52,6 +53,7 @@ class Volume(BaseModel): id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( default=None, description="Universally Unique Identifier (UUID)." ) + image_config: Optional[ImageConfig] = Field(default=None, alias="imageConfig") labels: Optional[Dict[str, Any]] = Field( default=None, description="Object that represents the labels of an object." ) @@ -78,6 +80,7 @@ class Volume(BaseModel): "createdAt", "description", "id", + "imageConfig", "labels", "name", "performanceClass", @@ -166,11 +169,13 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set( [ "created_at", "id", + "image_config", "server_id", "status", "updated_at", @@ -182,6 +187,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of image_config + if self.image_config: + _dict["imageConfig"] = self.image_config.to_dict() # override the default output from pydantic by calling `to_dict()` of source if self.source: _dict["source"] = self.source.to_dict() @@ -203,6 +211,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "createdAt": obj.get("createdAt"), "description": obj.get("description"), "id": obj.get("id"), + "imageConfig": ( + ImageConfig.from_dict(obj["imageConfig"]) if obj.get("imageConfig") is not None else None + ), "labels": obj.get("labels"), "name": obj.get("name"), "performanceClass": obj.get("performanceClass"),