diff --git a/services/iaasalpha/src/stackit/iaasalpha/__init__.py b/services/iaasalpha/src/stackit/iaasalpha/__init__.py index ae460008..22f42920 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/__init__.py +++ b/services/iaasalpha/src/stackit/iaasalpha/__init__.py @@ -40,18 +40,47 @@ from stackit.iaasalpha.models.add_volume_to_server_payload import ( AddVolumeToServerPayload, ) +from stackit.iaasalpha.models.affinity_group import AffinityGroup +from stackit.iaasalpha.models.affinity_group_list_response import ( + AffinityGroupListResponse, +) from stackit.iaasalpha.models.allowed_addresses_inner import AllowedAddressesInner from stackit.iaasalpha.models.area import Area from stackit.iaasalpha.models.area_config import AreaConfig from stackit.iaasalpha.models.area_id import AreaId from stackit.iaasalpha.models.area_prefix_config_ipv4 import AreaPrefixConfigIPv4 +from stackit.iaasalpha.models.availability_zone_list_response import ( + AvailabilityZoneListResponse, +) +from stackit.iaasalpha.models.backup import Backup +from stackit.iaasalpha.models.backup_list_response import BackupListResponse +from stackit.iaasalpha.models.backup_source import BackupSource from stackit.iaasalpha.models.base_security_group_rule import BaseSecurityGroupRule from stackit.iaasalpha.models.boot_volume import BootVolume from stackit.iaasalpha.models.boot_volume_source import BootVolumeSource +from stackit.iaasalpha.models.create_affinity_group_payload import ( + CreateAffinityGroupPayload, +) from stackit.iaasalpha.models.create_area_address_family import CreateAreaAddressFamily from stackit.iaasalpha.models.create_area_ipv4 import CreateAreaIPv4 +from stackit.iaasalpha.models.create_backup_payload import CreateBackupPayload from stackit.iaasalpha.models.create_image_payload import CreateImagePayload from stackit.iaasalpha.models.create_key_pair_payload import CreateKeyPairPayload +from stackit.iaasalpha.models.create_network_address_family import ( + CreateNetworkAddressFamily, +) +from stackit.iaasalpha.models.create_network_area_payload import ( + CreateNetworkAreaPayload, +) +from stackit.iaasalpha.models.create_network_area_range_payload import ( + CreateNetworkAreaRangePayload, +) +from stackit.iaasalpha.models.create_network_area_route_payload import ( + CreateNetworkAreaRoutePayload, +) +from stackit.iaasalpha.models.create_network_ipv4_body import CreateNetworkIPv4Body +from stackit.iaasalpha.models.create_network_ipv6_body import CreateNetworkIPv6Body +from stackit.iaasalpha.models.create_network_payload import CreateNetworkPayload from stackit.iaasalpha.models.create_nic_payload import CreateNicPayload from stackit.iaasalpha.models.create_protocol import CreateProtocol from stackit.iaasalpha.models.create_public_ip_payload import CreatePublicIPPayload @@ -72,17 +101,19 @@ from stackit.iaasalpha.models.create_server_payload_networking import ( CreateServerPayloadNetworking, ) +from stackit.iaasalpha.models.create_snapshot_payload import CreateSnapshotPayload from stackit.iaasalpha.models.create_virtual_ip_payload import CreateVirtualIPPayload from stackit.iaasalpha.models.create_volume_payload import CreateVolumePayload from stackit.iaasalpha.models.error import Error from stackit.iaasalpha.models.get_server_log200_response import GetServerLog200Response -from stackit.iaasalpha.models.get_server_log_request import GetServerLogRequest from stackit.iaasalpha.models.icmp_parameters import ICMPParameters from stackit.iaasalpha.models.image import Image from stackit.iaasalpha.models.image_checksum import ImageChecksum from stackit.iaasalpha.models.image_config import ImageConfig from stackit.iaasalpha.models.image_create_response import ImageCreateResponse from stackit.iaasalpha.models.image_list_response import ImageListResponse +from stackit.iaasalpha.models.image_share import ImageShare +from stackit.iaasalpha.models.image_share_consumer import ImageShareConsumer from stackit.iaasalpha.models.key_pair_list_response import KeyPairListResponse from stackit.iaasalpha.models.keypair import Keypair from stackit.iaasalpha.models.machine_type import MachineType @@ -93,8 +124,17 @@ from stackit.iaasalpha.models.network_area_list_response import NetworkAreaListResponse from stackit.iaasalpha.models.network_list_response import NetworkListResponse from stackit.iaasalpha.models.network_range import NetworkRange +from stackit.iaasalpha.models.network_range_list_response import ( + NetworkRangeListResponse, +) from stackit.iaasalpha.models.nic import NIC from stackit.iaasalpha.models.nic_list_response import NICListResponse +from stackit.iaasalpha.models.partial_update_network_area_payload import ( + PartialUpdateNetworkAreaPayload, +) +from stackit.iaasalpha.models.partial_update_network_payload import ( + PartialUpdateNetworkPayload, +) from stackit.iaasalpha.models.port_range import PortRange from stackit.iaasalpha.models.project import Project from stackit.iaasalpha.models.project_list_response import ProjectListResponse @@ -105,6 +145,9 @@ from stackit.iaasalpha.models.public_network_list_response import ( PublicNetworkListResponse, ) +from stackit.iaasalpha.models.quota import Quota +from stackit.iaasalpha.models.quota_list import QuotaList +from stackit.iaasalpha.models.quota_list_response import QuotaListResponse from stackit.iaasalpha.models.remove_member_from_virtual_ip_payload import ( RemoveMemberFromVirtualIPPayload, ) @@ -114,6 +157,7 @@ from stackit.iaasalpha.models.resize_server_payload import ResizeServerPayload from stackit.iaasalpha.models.resize_volume_payload import ResizeVolumePayload from stackit.iaasalpha.models.route import Route +from stackit.iaasalpha.models.route_list_response import RouteListResponse from stackit.iaasalpha.models.security_group import SecurityGroup from stackit.iaasalpha.models.security_group_list_response import ( SecurityGroupListResponse, @@ -133,22 +177,36 @@ from stackit.iaasalpha.models.service_account_mail_list_response import ( ServiceAccountMailListResponse, ) +from stackit.iaasalpha.models.set_image_share_payload import SetImageSharePayload +from stackit.iaasalpha.models.snapshot import Snapshot +from stackit.iaasalpha.models.snapshot_list_response import SnapshotListResponse from stackit.iaasalpha.models.static_area_id import StaticAreaID from stackit.iaasalpha.models.update_area_address_family import UpdateAreaAddressFamily from stackit.iaasalpha.models.update_area_ipv4 import UpdateAreaIPv4 from stackit.iaasalpha.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaasalpha.models.update_backup_payload import UpdateBackupPayload from stackit.iaasalpha.models.update_image_payload import UpdateImagePayload +from stackit.iaasalpha.models.update_image_share_payload import UpdateImageSharePayload from stackit.iaasalpha.models.update_key_pair_payload import UpdateKeyPairPayload +from stackit.iaasalpha.models.update_network_address_family import ( + UpdateNetworkAddressFamily, +) +from stackit.iaasalpha.models.update_network_ipv4_body import UpdateNetworkIPv4Body +from stackit.iaasalpha.models.update_network_ipv6_body import UpdateNetworkIPv6Body from stackit.iaasalpha.models.update_nic_payload import UpdateNicPayload from stackit.iaasalpha.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaasalpha.models.update_security_group_payload import ( UpdateSecurityGroupPayload, ) from stackit.iaasalpha.models.update_server_payload import UpdateServerPayload +from stackit.iaasalpha.models.update_snapshot_payload import UpdateSnapshotPayload from stackit.iaasalpha.models.update_virtual_ip_payload import UpdateVirtualIPPayload from stackit.iaasalpha.models.update_volume_payload import UpdateVolumePayload +from stackit.iaasalpha.models.v1alpha1_update_route_of_area_payload import ( + V1alpha1UpdateRouteOfAreaPayload, +) from stackit.iaasalpha.models.virtual_ip import VirtualIp from stackit.iaasalpha.models.virtual_ip_list_response import VirtualIpListResponse from stackit.iaasalpha.models.volume import Volume diff --git a/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py b/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py index d4e55fa4..9b3990aa 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py +++ b/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py @@ -33,8 +33,31 @@ from stackit.iaasalpha.models.add_volume_to_server_payload import ( AddVolumeToServerPayload, ) +from stackit.iaasalpha.models.affinity_group import AffinityGroup +from stackit.iaasalpha.models.affinity_group_list_response import ( + AffinityGroupListResponse, +) +from stackit.iaasalpha.models.availability_zone_list_response import ( + AvailabilityZoneListResponse, +) +from stackit.iaasalpha.models.backup import Backup +from stackit.iaasalpha.models.backup_list_response import BackupListResponse +from stackit.iaasalpha.models.create_affinity_group_payload import ( + CreateAffinityGroupPayload, +) +from stackit.iaasalpha.models.create_backup_payload import CreateBackupPayload from stackit.iaasalpha.models.create_image_payload import CreateImagePayload from stackit.iaasalpha.models.create_key_pair_payload import CreateKeyPairPayload +from stackit.iaasalpha.models.create_network_area_payload import ( + CreateNetworkAreaPayload, +) +from stackit.iaasalpha.models.create_network_area_range_payload import ( + CreateNetworkAreaRangePayload, +) +from stackit.iaasalpha.models.create_network_area_route_payload import ( + CreateNetworkAreaRoutePayload, +) +from stackit.iaasalpha.models.create_network_payload import CreateNetworkPayload from stackit.iaasalpha.models.create_nic_payload import CreateNicPayload from stackit.iaasalpha.models.create_public_ip_payload import CreatePublicIPPayload from stackit.iaasalpha.models.create_security_group_payload import ( @@ -44,13 +67,15 @@ CreateSecurityGroupRulePayload, ) from stackit.iaasalpha.models.create_server_payload import CreateServerPayload +from stackit.iaasalpha.models.create_snapshot_payload import CreateSnapshotPayload from stackit.iaasalpha.models.create_virtual_ip_payload import CreateVirtualIPPayload from stackit.iaasalpha.models.create_volume_payload import CreateVolumePayload from stackit.iaasalpha.models.get_server_log200_response import GetServerLog200Response -from stackit.iaasalpha.models.get_server_log_request import GetServerLogRequest from stackit.iaasalpha.models.image import Image from stackit.iaasalpha.models.image_create_response import ImageCreateResponse from stackit.iaasalpha.models.image_list_response import ImageListResponse +from stackit.iaasalpha.models.image_share import ImageShare +from stackit.iaasalpha.models.image_share_consumer import ImageShareConsumer from stackit.iaasalpha.models.key_pair_list_response import KeyPairListResponse from stackit.iaasalpha.models.keypair import Keypair from stackit.iaasalpha.models.machine_type import MachineType @@ -59,8 +84,18 @@ from stackit.iaasalpha.models.network_area import NetworkArea from stackit.iaasalpha.models.network_area_list_response import NetworkAreaListResponse from stackit.iaasalpha.models.network_list_response import NetworkListResponse +from stackit.iaasalpha.models.network_range import NetworkRange +from stackit.iaasalpha.models.network_range_list_response import ( + NetworkRangeListResponse, +) from stackit.iaasalpha.models.nic import NIC from stackit.iaasalpha.models.nic_list_response import NICListResponse +from stackit.iaasalpha.models.partial_update_network_area_payload import ( + PartialUpdateNetworkAreaPayload, +) +from stackit.iaasalpha.models.partial_update_network_payload import ( + PartialUpdateNetworkPayload, +) from stackit.iaasalpha.models.project import Project from stackit.iaasalpha.models.project_list_response import ProjectListResponse from stackit.iaasalpha.models.public_ip import PublicIp @@ -68,6 +103,7 @@ from stackit.iaasalpha.models.public_network_list_response import ( PublicNetworkListResponse, ) +from stackit.iaasalpha.models.quota_list_response import QuotaListResponse from stackit.iaasalpha.models.remove_member_from_virtual_ip_payload import ( RemoveMemberFromVirtualIPPayload, ) @@ -75,6 +111,8 @@ from stackit.iaasalpha.models.rescue_server_payload import RescueServerPayload from stackit.iaasalpha.models.resize_server_payload import ResizeServerPayload from stackit.iaasalpha.models.resize_volume_payload import ResizeVolumePayload +from stackit.iaasalpha.models.route import Route +from stackit.iaasalpha.models.route_list_response import RouteListResponse from stackit.iaasalpha.models.security_group import SecurityGroup from stackit.iaasalpha.models.security_group_list_response import ( SecurityGroupListResponse, @@ -89,10 +127,15 @@ from stackit.iaasalpha.models.service_account_mail_list_response import ( ServiceAccountMailListResponse, ) +from stackit.iaasalpha.models.set_image_share_payload import SetImageSharePayload +from stackit.iaasalpha.models.snapshot import Snapshot +from stackit.iaasalpha.models.snapshot_list_response import SnapshotListResponse from stackit.iaasalpha.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaasalpha.models.update_backup_payload import UpdateBackupPayload from stackit.iaasalpha.models.update_image_payload import UpdateImagePayload +from stackit.iaasalpha.models.update_image_share_payload import UpdateImageSharePayload from stackit.iaasalpha.models.update_key_pair_payload import UpdateKeyPairPayload from stackit.iaasalpha.models.update_nic_payload import UpdateNicPayload from stackit.iaasalpha.models.update_public_ip_payload import UpdatePublicIPPayload @@ -100,8 +143,12 @@ UpdateSecurityGroupPayload, ) from stackit.iaasalpha.models.update_server_payload import UpdateServerPayload +from stackit.iaasalpha.models.update_snapshot_payload import UpdateSnapshotPayload from stackit.iaasalpha.models.update_virtual_ip_payload import UpdateVirtualIPPayload from stackit.iaasalpha.models.update_volume_payload import UpdateVolumePayload +from stackit.iaasalpha.models.v1alpha1_update_route_of_area_payload import ( + V1alpha1UpdateRouteOfAreaPayload, +) from stackit.iaasalpha.models.virtual_ip import VirtualIp from stackit.iaasalpha.models.virtual_ip_list_response import VirtualIpListResponse from stackit.iaasalpha.models.volume import Volume @@ -2296,13 +2343,15 @@ def _add_volume_to_server_serialize( ) @validate_call - def create_image( + def create_affinity_group( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], + create_affinity_group_payload: Annotated[ + CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2312,15 +2361,15 @@ def create_image( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageCreateResponse: - """Create new Image. + ) -> AffinityGroup: + """Create a new affinity group in a project. - Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + Create a new server affinity group in the given project ID. :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 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 @@ -2343,9 +2392,9 @@ def create_image( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_image_serialize( + _param = self._create_affinity_group_serialize( project_id=project_id, - create_image_payload=create_image_payload, + create_affinity_group_payload=create_affinity_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2353,12 +2402,11 @@ def create_image( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ImageCreateResponse", + "201": "AffinityGroup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2369,13 +2417,15 @@ def create_image( ).data @validate_call - def create_image_with_http_info( + def create_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."), ], - create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], + create_affinity_group_payload: Annotated[ + CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2385,15 +2435,15 @@ def create_image_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[ImageCreateResponse]: - """Create new Image. + ) -> ApiResponse[AffinityGroup]: + """Create a new affinity group in a project. - Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + Create a new server affinity group in the given project ID. :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 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 @@ -2416,9 +2466,9 @@ def create_image_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_image_serialize( + _param = self._create_affinity_group_serialize( project_id=project_id, - create_image_payload=create_image_payload, + create_affinity_group_payload=create_affinity_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2426,12 +2476,11 @@ def create_image_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ImageCreateResponse", + "201": "AffinityGroup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2442,13 +2491,15 @@ def create_image_with_http_info( ) @validate_call - def create_image_without_preload_content( + def create_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."), ], - create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], + create_affinity_group_payload: Annotated[ + CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2459,14 +2510,14 @@ def create_image_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new Image. + """Create a new affinity group in a project. - Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + Create a new server affinity group in the given project ID. :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 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 @@ -2489,9 +2540,9 @@ def create_image_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_image_serialize( + _param = self._create_affinity_group_serialize( project_id=project_id, - create_image_payload=create_image_payload, + create_affinity_group_payload=create_affinity_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2499,21 +2550,20 @@ def create_image_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ImageCreateResponse", + "201": "AffinityGroup", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "429": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_image_serialize( + def _create_affinity_group_serialize( self, project_id, - create_image_payload, + create_affinity_group_payload, _request_auth, _content_type, _headers, @@ -2538,8 +2588,8 @@ def _create_image_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_image_payload is not None: - _body_params = create_image_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: @@ -2558,7 +2608,7 @@ def _create_image_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/images", + resource_path="/v1alpha1/projects/{projectId}/affinity-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2572,9 +2622,13 @@ def _create_image_serialize( ) @validate_call - def create_key_pair( + def create_backup( 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_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2584,13 +2638,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. + ) -> Backup: + """Create new Backup. - 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 Backup in a project. If a snapshot ID is provided create the backup from the snapshot. - :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_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 @@ -2613,8 +2669,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_backup_serialize( + project_id=project_id, + create_backup_payload=create_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2622,12 +2679,11 @@ def create_key_pair( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", + "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) @@ -2638,9 +2694,13 @@ def create_key_pair( ).data @validate_call - def create_key_pair_with_http_info( + def create_backup_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_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2650,13 +2710,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[Backup]: + """Create new Backup. - 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 Backup in a project. If a snapshot ID is provided create the backup from the snapshot. - :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_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 @@ -2679,8 +2741,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_backup_serialize( + project_id=project_id, + create_backup_payload=create_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2688,12 +2751,11 @@ def create_key_pair_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", + "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) @@ -2704,9 +2766,13 @@ def create_key_pair_with_http_info( ) @validate_call - def create_key_pair_without_preload_content( + def create_backup_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_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2717,12 +2783,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 new Backup. - 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 Backup in a project. If a snapshot ID is provided create the backup from the snapshot. - :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_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 @@ -2745,8 +2813,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_backup_serialize( + project_id=project_id, + create_backup_payload=create_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2754,20 +2823,20 @@ def create_key_pair_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", + "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_key_pair_serialize( + def _create_backup_serialize( self, - create_key_pair_payload, + project_id, + create_backup_payload, _request_auth, _content_type, _headers, @@ -2786,12 +2855,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_backup_payload is not None: + _body_params = create_backup_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -2810,7 +2881,7 @@ def _create_key_pair_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/keypairs", + resource_path="/v1alpha1/projects/{projectId}/backups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2824,17 +2895,13 @@ def _create_key_pair_serialize( ) @validate_call - def create_nic( + def create_image( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], + create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2844,17 +2911,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. + ) -> ImageCreateResponse: + """Create new Image. - Create a new network interface in a project. + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param 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 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 @@ -2877,10 +2942,9 @@ def create_nic( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_nic_serialize( + _param = self._create_image_serialize( project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, + create_image_payload=create_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2888,12 +2952,11 @@ def create_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "NIC", + "201": "ImageCreateResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "429": "Error", "500": "Error", } @@ -2905,17 +2968,13 @@ def create_nic( ).data @validate_call - def create_nic_with_http_info( + def create_image_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], + create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2925,17 +2984,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[ImageCreateResponse]: + """Create new Image. - Create a new network interface in a project. + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param 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 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 @@ -2958,10 +3015,9 @@ def create_nic_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_nic_serialize( + _param = self._create_image_serialize( project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, + create_image_payload=create_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2969,12 +3025,11 @@ def create_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "NIC", + "201": "ImageCreateResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "429": "Error", "500": "Error", } @@ -2986,17 +3041,13 @@ def create_nic_with_http_info( ) @validate_call - def create_nic_without_preload_content( + def create_image_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], + create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3007,16 +3058,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 Image. - Create a new network interface in a project. + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param 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 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 @@ -3039,10 +3088,9 @@ def create_nic_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_nic_serialize( + _param = self._create_image_serialize( project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, + create_image_payload=create_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3050,23 +3098,21 @@ def create_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "NIC", + "201": "ImageCreateResponse", "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_image_serialize( self, project_id, - network_id, - create_nic_payload, + create_image_payload, _request_auth, _content_type, _headers, @@ -3087,14 +3133,12 @@ def _create_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 # 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_image_payload is not None: + _body_params = create_image_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3113,7 +3157,7 @@ def _create_nic_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics", + resource_path="/v1alpha1/projects/{projectId}/images", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3127,13 +3171,9 @@ def _create_nic_serialize( ) @validate_call - def create_public_ip( + def create_key_pair( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3143,15 +3183,13 @@ 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. + ) -> Keypair: + """Import a public key. - Create a new public IP 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. - :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 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 @@ -3174,9 +3212,8 @@ 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_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3184,12 +3221,12 @@ def create_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", + "201": "Keypair", "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) @@ -3200,13 +3237,9 @@ def create_public_ip( ).data @validate_call - def create_public_ip_with_http_info( + def create_key_pair_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3216,15 +3249,13 @@ 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[Keypair]: + """Import a public key. - Create a new public IP 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. - :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 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 @@ -3247,9 +3278,8 @@ 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_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3257,12 +3287,12 @@ def create_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", + "201": "Keypair", "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) @@ -3273,13 +3303,9 @@ def create_public_ip_with_http_info( ) @validate_call - def create_public_ip_without_preload_content( + def create_key_pair_without_preload_content( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], + create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3290,14 +3316,12 @@ 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. + """Import a public key. - Create a new public IP 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. - :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 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 @@ -3320,9 +3344,8 @@ 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_key_pair_serialize( + create_key_pair_payload=create_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3330,21 +3353,20 @@ def create_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", + "201": "Keypair", "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_key_pair_serialize( self, - project_id, - create_public_ip_payload, + create_key_pair_payload, _request_auth, _content_type, _headers, @@ -3363,14 +3385,12 @@ 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 # 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_key_pair_payload is not None: + _body_params = create_key_pair_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3389,7 +3409,7 @@ def _create_public_ip_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/public-ips", + resource_path="/v1alpha1/keypairs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3403,15 +3423,13 @@ def _create_public_ip_serialize( ) @validate_call - def create_security_group( + def create_network( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group creation.") - ], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3421,15 +3439,15 @@ 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. + ) -> Network: + """Create new network. - Create a new security group in a project. + 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 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 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 @@ -3452,9 +3470,9 @@ def create_security_group( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_security_group_serialize( + _param = self._create_network_serialize( project_id=project_id, - create_security_group_payload=create_security_group_payload, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3462,11 +3480,12 @@ def create_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroup", + "202": "Network", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3477,15 +3496,13 @@ def create_security_group( ).data @validate_call - def create_security_group_with_http_info( + def create_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."), ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group creation.") - ], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3495,15 +3512,15 @@ 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[Network]: + """Create new network. - Create a new security group in a project. + 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 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 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 @@ -3526,9 +3543,9 @@ 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( + _param = self._create_network_serialize( project_id=project_id, - create_security_group_payload=create_security_group_payload, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3536,11 +3553,12 @@ def create_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroup", + "202": "Network", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3551,15 +3569,13 @@ def create_security_group_with_http_info( ) @validate_call - def create_security_group_without_preload_content( + def create_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."), ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group creation.") - ], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3570,14 +3586,14 @@ 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. - Create a new security group in a project. + 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 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 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 @@ -3600,9 +3616,9 @@ 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( + _param = self._create_network_serialize( project_id=project_id, - create_security_group_payload=create_security_group_payload, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3610,20 +3626,21 @@ def create_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroup", + "202": "Network", "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_serialize( self, project_id, - create_security_group_payload, + create_network_payload, _request_auth, _content_type, _headers, @@ -3648,8 +3665,8 @@ def _create_security_group_serialize( # 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_payload is not None: + _body_params = create_network_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -3668,7 +3685,7 @@ def _create_security_group_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/security-groups", + resource_path="/v1alpha1/projects/{projectId}/networks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3682,23 +3699,16 @@ def _create_security_group_serialize( ) @validate_call - def create_security_group_rule( + def create_network_area( 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." ), ], - create_security_group_rule_payload: Annotated[ - CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") + create_network_area_payload: Annotated[ + CreateNetworkAreaPayload, Field(description="Request an Area creation.") ], _request_timeout: Union[ None, @@ -3709,17 +3719,15 @@ 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. + ) -> NetworkArea: + """Create new network area in an organization. - Create a new security group rule 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 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 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 @@ -3742,10 +3750,9 @@ def create_security_group_rule( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_security_group_rule_serialize( - project_id=project_id, - security_group_id=security_group_id, - create_security_group_rule_payload=create_security_group_rule_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, @@ -3753,7 +3760,7 @@ def create_security_group_rule( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroupRule", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -3768,23 +3775,16 @@ def create_security_group_rule( ).data @validate_call - def create_security_group_rule_with_http_info( + def create_network_area_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." ), ], - create_security_group_rule_payload: Annotated[ - CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") + create_network_area_payload: Annotated[ + CreateNetworkAreaPayload, Field(description="Request an Area creation.") ], _request_timeout: Union[ None, @@ -3795,17 +3795,15 @@ 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[NetworkArea]: + """Create new network area in an organization. - Create a new security group rule 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 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 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 @@ -3828,10 +3826,9 @@ 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( - project_id=project_id, - security_group_id=security_group_id, - create_security_group_rule_payload=create_security_group_rule_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, @@ -3839,7 +3836,7 @@ def create_security_group_rule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroupRule", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -3854,23 +3851,16 @@ def create_security_group_rule_with_http_info( ) @validate_call - def create_security_group_rule_without_preload_content( + def create_network_area_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." ), ], - create_security_group_rule_payload: Annotated[ - CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") + create_network_area_payload: Annotated[ + CreateNetworkAreaPayload, Field(description="Request an Area creation.") ], _request_timeout: Union[ None, @@ -3882,16 +3872,14 @@ 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 area in an organization. - Create a new security group rule 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 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 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 @@ -3914,10 +3902,9 @@ 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( - project_id=project_id, - security_group_id=security_group_id, - create_security_group_rule_payload=create_security_group_rule_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, @@ -3925,7 +3912,7 @@ def create_security_group_rule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SecurityGroupRule", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -3935,11 +3922,10 @@ def create_security_group_rule_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_security_group_rule_serialize( + def _create_network_area_serialize( self, - project_id, - security_group_id, - create_security_group_rule_payload, + organization_id, + create_network_area_payload, _request_auth, _content_type, _headers, @@ -3958,16 +3944,14 @@ def _create_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 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_security_group_rule_payload is not None: - _body_params = create_security_group_rule_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: @@ -3986,7 +3970,7 @@ def _create_security_group_rule_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4000,13 +3984,23 @@ def _create_security_group_rule_serialize( ) @validate_call - def create_server( + 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_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4016,15 +4010,17 @@ 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. + ) -> NetworkRangeListResponse: + """Create new network range in a network area. - Create a new server 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_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload + :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 @@ -4047,9 +4043,10 @@ def create_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_server_serialize( - project_id=project_id, - create_server_payload=create_server_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, @@ -4057,11 +4054,12 @@ def create_server( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Server", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4072,13 +4070,23 @@ def create_server( ).data @validate_call - def create_server_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_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4088,15 +4096,17 @@ 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[NetworkRangeListResponse]: + """Create new network range in a network area. - Create a new server 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_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload + :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 @@ -4119,9 +4129,10 @@ def create_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_server_serialize( - project_id=project_id, - create_server_payload=create_server_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, @@ -4129,11 +4140,12 @@ def create_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Server", + "200": "NetworkRangeListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4144,13 +4156,23 @@ def create_server_with_http_info( ) @validate_call - def create_server_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_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4161,14 +4183,16 @@ 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 network range in a network area. - Create a new server 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_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload + :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 @@ -4191,9 +4215,10 @@ def create_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_server_serialize( - project_id=project_id, - create_server_payload=create_server_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, @@ -4201,20 +4226,22 @@ def create_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Server", + "200": "NetworkRangeListResponse", "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_server_serialize( + def _create_network_area_range_serialize( self, - project_id, - create_server_payload, + organization_id, + area_id, + create_network_area_range_payload, _request_auth, _content_type, _headers, @@ -4233,14 +4260,16 @@ def _create_server_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_server_payload is not None: - _body_params = create_server_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: @@ -4259,7 +4288,7 @@ def _create_server_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4273,18 +4302,22 @@ def _create_server_serialize( ) @validate_call - def create_virtual_ip( + 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." + ), ], - network_id: Annotated[ + area_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 Network Area." + ), ], - create_virtual_ip_payload: Annotated[ - CreateVirtualIPPayload, Field(description="Request a virtual IP creation.") + create_network_area_route_payload: Annotated[ + CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") ], _request_timeout: Union[ None, @@ -4295,17 +4328,17 @@ def create_virtual_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VirtualIp: - """Create new virtual IP. + ) -> RouteListResponse: + """Create new network routes. - Create a new virtual IP 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_virtual_ip_payload: Request a virtual IP creation. (required) - :type create_virtual_ip_payload: CreateVirtualIPPayload + :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 @@ -4328,10 +4361,10 @@ def create_virtual_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - create_virtual_ip_payload=create_virtual_ip_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, @@ -4339,12 +4372,12 @@ def create_virtual_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "VirtualIp", + "202": "RouteListResponse", "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) @@ -4355,18 +4388,22 @@ def create_virtual_ip( ).data @validate_call - def create_virtual_ip_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." + ), ], - network_id: Annotated[ + area_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 Network Area." + ), ], - create_virtual_ip_payload: Annotated[ - CreateVirtualIPPayload, Field(description="Request a virtual IP creation.") + create_network_area_route_payload: Annotated[ + CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") ], _request_timeout: Union[ None, @@ -4377,17 +4414,17 @@ def create_virtual_ip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VirtualIp]: - """Create new virtual IP. + ) -> ApiResponse[RouteListResponse]: + """Create new network routes. - Create a new virtual IP 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_virtual_ip_payload: Request a virtual IP creation. (required) - :type create_virtual_ip_payload: CreateVirtualIPPayload + :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 @@ -4410,10 +4447,10 @@ def create_virtual_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - create_virtual_ip_payload=create_virtual_ip_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, @@ -4421,12 +4458,12 @@ def create_virtual_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "VirtualIp", + "202": "RouteListResponse", "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) @@ -4437,18 +4474,22 @@ def create_virtual_ip_with_http_info( ) @validate_call - def create_virtual_ip_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." + ), ], - network_id: Annotated[ + area_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 Network Area." + ), ], - create_virtual_ip_payload: Annotated[ - CreateVirtualIPPayload, Field(description="Request a virtual IP creation.") + create_network_area_route_payload: Annotated[ + CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an area.") ], _request_timeout: Union[ None, @@ -4460,16 +4501,16 @@ def create_virtual_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create new virtual IP. + """Create new network routes. - Create a new virtual IP 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_virtual_ip_payload: Request a virtual IP creation. (required) - :type create_virtual_ip_payload: CreateVirtualIPPayload + :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 @@ -4492,10 +4533,10 @@ def create_virtual_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - create_virtual_ip_payload=create_virtual_ip_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, @@ -4503,22 +4544,22 @@ def create_virtual_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "VirtualIp", + "202": "RouteListResponse", "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_virtual_ip_serialize( + def _create_network_area_route_serialize( self, - project_id, - network_id, - create_virtual_ip_payload, + organization_id, + area_id, + create_network_area_route_payload, _request_auth, _content_type, _headers, @@ -4537,16 +4578,16 @@ def _create_virtual_ip_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 + 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_virtual_ip_payload is not None: - _body_params = create_virtual_ip_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: @@ -4565,7 +4606,7 @@ def _create_virtual_ip_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4579,13 +4620,17 @@ def _create_virtual_ip_serialize( ) @validate_call - def create_volume( + 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."), ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4595,15 +4640,17 @@ 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. + ) -> NIC: + """Create new network interface. - 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 network interface 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 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 @@ -4626,9 +4673,10 @@ def create_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_volume_serialize( + _param = self._create_nic_serialize( project_id=project_id, - create_volume_payload=create_volume_payload, + network_id=network_id, + create_nic_payload=create_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4636,11 +4684,13 @@ def create_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", + "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) @@ -4651,13 +4701,17 @@ def create_volume( ).data @validate_call - def create_volume_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."), ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4667,15 +4721,17 @@ 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[NIC]: + """Create new network interface. - 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 network interface 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 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 @@ -4698,9 +4754,10 @@ 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_nic_serialize( project_id=project_id, - create_volume_payload=create_volume_payload, + network_id=network_id, + create_nic_payload=create_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4708,11 +4765,13 @@ def create_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", + "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) @@ -4723,13 +4782,17 @@ def create_volume_with_http_info( ) @validate_call - def create_volume_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."), ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4740,14 +4803,16 @@ 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 network interface. - 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 network interface 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 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 @@ -4770,9 +4835,10 @@ 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_nic_serialize( project_id=project_id, - create_volume_payload=create_volume_payload, + network_id=network_id, + create_nic_payload=create_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4780,20 +4846,23 @@ def create_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", + "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_volume_serialize( + def _create_nic_serialize( self, project_id, - create_volume_payload, + network_id, + create_nic_payload, _request_auth, _content_type, _headers, @@ -4814,12 +4883,14 @@ def _create_volume_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_volume_payload is not None: - _body_params = create_volume_payload + if create_nic_payload is not None: + _body_params = create_nic_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -4838,7 +4909,7 @@ def _create_volume_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/volumes", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4852,16 +4923,13 @@ def _create_volume_serialize( ) @validate_call - def deallocate_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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4871,15 +4939,15 @@ 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. + ) -> PublicIp: + """Create new public IP. - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + Create a new public IP 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 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 @@ -4902,9 +4970,9 @@ def deallocate_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._deallocate_server_serialize( + _param = self._create_public_ip_serialize( project_id=project_id, - server_id=server_id, + create_public_ip_payload=create_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4912,12 +4980,12 @@ def deallocate_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "PublicIp", "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) @@ -4928,16 +4996,13 @@ def deallocate_server( ).data @validate_call - def deallocate_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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4947,15 +5012,15 @@ 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[PublicIp]: + """Create new public IP. - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + Create a new public IP 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 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 @@ -4978,9 +5043,9 @@ 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_public_ip_serialize( project_id=project_id, - server_id=server_id, + create_public_ip_payload=create_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4988,12 +5053,12 @@ def deallocate_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "PublicIp", "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) @@ -5004,16 +5069,13 @@ def deallocate_server_with_http_info( ) @validate_call - def deallocate_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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], + create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5024,14 +5086,14 @@ 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 public IP. - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + Create a new public IP 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 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 @@ -5054,9 +5116,9 @@ 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_public_ip_serialize( project_id=project_id, - server_id=server_id, + create_public_ip_payload=create_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5064,21 +5126,21 @@ def deallocate_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "PublicIp", "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 _deallocate_server_serialize( + def _create_public_ip_serialize( self, project_id, - server_id, + create_public_ip_payload, _request_auth, _content_type, _headers, @@ -5099,23 +5161,31 @@ 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 # 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 # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate", + resource_path="/v1alpha1/projects/{projectId}/public-ips", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5129,14 +5199,14 @@ def _deallocate_server_serialize( ) @validate_call - def delete_image( + 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."), ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + create_security_group_payload: Annotated[ + CreateSecurityGroupPayload, Field(description="Request a security group creation.") ], _request_timeout: Union[ None, @@ -5147,15 +5217,15 @@ def delete_image( _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. + ) -> SecurityGroup: + """Create new security group. - Delete an image that is part of the project. + Create a new security group in 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 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 @@ -5178,9 +5248,9 @@ def delete_image( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_image_serialize( + _param = self._create_security_group_serialize( project_id=project_id, - image_id=image_id, + create_security_group_payload=create_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5188,7 +5258,7 @@ def delete_image( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "SecurityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -5203,14 +5273,14 @@ def delete_image( ).data @validate_call - def delete_image_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."), ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + create_security_group_payload: Annotated[ + CreateSecurityGroupPayload, Field(description="Request a security group creation.") ], _request_timeout: Union[ None, @@ -5221,15 +5291,15 @@ def delete_image_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 Image. + ) -> ApiResponse[SecurityGroup]: + """Create new security group. - Delete an image that is part of the project. + Create a new security group in 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 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 @@ -5252,9 +5322,9 @@ def delete_image_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_image_serialize( + _param = self._create_security_group_serialize( project_id=project_id, - image_id=image_id, + create_security_group_payload=create_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5262,7 +5332,7 @@ def delete_image_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "SecurityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -5277,14 +5347,14 @@ def delete_image_with_http_info( ) @validate_call - def delete_image_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."), ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + create_security_group_payload: Annotated[ + CreateSecurityGroupPayload, Field(description="Request a security group creation.") ], _request_timeout: Union[ None, @@ -5296,14 +5366,14 @@ def delete_image_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete an Image. + """Create new security group. - Delete an image that is part of the project. + Create a new security group in 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 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 @@ -5326,9 +5396,9 @@ def delete_image_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_image_serialize( + _param = self._create_security_group_serialize( project_id=project_id, - image_id=image_id, + create_security_group_payload=create_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5336,7 +5406,7 @@ def delete_image_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "SecurityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -5346,10 +5416,10 @@ def delete_image_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_image_serialize( + def _create_security_group_serialize( self, project_id, - image_id, + create_security_group_payload, _request_auth, _content_type, _headers, @@ -5370,23 +5440,31 @@ def _delete_image_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_security_group_payload is not None: + _body_params = create_security_group_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="/v1alpha1/projects/{projectId}/images/{imageId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/security-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5400,9 +5478,24 @@ def _delete_image_serialize( ) @validate_call - def delete_key_pair( + def create_security_group_rule( 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."), + ], + security_group_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.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5412,13 +5505,17 @@ 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. + ) -> SecurityGroupRule: + """Create new security group rule. - Delete an SSH keypair from a user. + Create a new security group rule 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 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 @@ -5441,8 +5538,10 @@ 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_security_group_rule_serialize( + project_id=project_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, @@ -5450,7 +5549,7 @@ def delete_key_pair( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "SecurityGroupRule", "400": "Error", "401": "Error", "403": "Error", @@ -5465,25 +5564,44 @@ def delete_key_pair( ).data @validate_call - def delete_key_pair_with_http_info( + def create_security_group_rule_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, + 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.", + ), + ], + create_security_group_rule_payload: Annotated[ + CreateSecurityGroupRulePayload, Field(description="Request for a security group rule creation.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete an SSH keypair. + ) -> ApiResponse[SecurityGroupRule]: + """Create new security group rule. - Delete an SSH keypair from a user. + Create a new security group rule 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 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 @@ -5506,8 +5624,10 @@ 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_security_group_rule_serialize( + project_id=project_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, @@ -5515,7 +5635,7 @@ def delete_key_pair_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "SecurityGroupRule", "400": "Error", "401": "Error", "403": "Error", @@ -5530,9 +5650,24 @@ def delete_key_pair_with_http_info( ) @validate_call - def delete_key_pair_without_preload_content( + def create_security_group_rule_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."), + ], + security_group_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.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5543,12 +5678,16 @@ 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 security group rule. - Delete an SSH keypair from a user. + Create a new security group rule 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 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 @@ -5571,8 +5710,10 @@ 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_security_group_rule_serialize( + project_id=project_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, @@ -5580,7 +5721,7 @@ def delete_key_pair_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "SecurityGroupRule", "400": "Error", "401": "Error", "403": "Error", @@ -5590,9 +5731,11 @@ 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_security_group_rule_serialize( self, - keypair_name, + project_id, + security_group_id, + create_security_group_rule_payload, _request_auth, _content_type, _headers, @@ -5611,23 +5754,35 @@ 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 + 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="DELETE", - resource_path="/v1alpha1/keypairs/{keypairName}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5641,20 +5796,13 @@ def _delete_key_pair_serialize( ) @validate_call - def delete_nic( + def create_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[ - 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."), - ], + create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5664,17 +5812,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. + ) -> Server: + """Create new server. - Delete a network interface that is part of the project. + Create a new server 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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_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 @@ -5697,10 +5843,9 @@ def delete_nic( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_nic_serialize( + _param = self._create_server_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + create_server_payload=create_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5708,7 +5853,7 @@ def delete_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -5723,20 +5868,13 @@ def delete_nic( ).data @validate_call - def delete_nic_with_http_info( + def create_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[ - 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."), - ], + create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5746,17 +5884,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[Server]: + """Create new server. - Delete a network interface that is part of the project. + Create a new server 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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_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 @@ -5779,10 +5915,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._create_server_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + create_server_payload=create_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5790,7 +5925,7 @@ def delete_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -5805,20 +5940,13 @@ def delete_nic_with_http_info( ) @validate_call - def delete_nic_without_preload_content( + def create_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[ - 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."), - ], + create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5829,16 +5957,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. + """Create new server. - Delete a network interface that is part of the project. + Create a new server 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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_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 @@ -5861,10 +5987,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._create_server_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, + create_server_payload=create_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5872,7 +5997,7 @@ def delete_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -5882,11 +6007,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 _create_server_serialize( self, project_id, - network_id, - nic_id, + create_server_payload, _request_auth, _content_type, _headers, @@ -5907,25 +6031,31 @@ 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 # 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="/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/servers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5939,15 +6069,13 @@ def _delete_nic_serialize( ) @validate_call - def delete_public_ip( + 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."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], + create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5957,15 +6085,15 @@ 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. + ) -> Snapshot: + """Create new Snapshot. - Delete a public IP that is part of the project. + 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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_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 @@ -5988,9 +6116,9 @@ def delete_public_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_public_ip_serialize( + _param = self._create_snapshot_serialize( project_id=project_id, - public_ip_id=public_ip_id, + create_snapshot_payload=create_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5998,7 +6126,7 @@ def delete_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -6013,15 +6141,13 @@ def delete_public_ip( ).data @validate_call - def delete_public_ip_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."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], + create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6031,15 +6157,15 @@ 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[Snapshot]: + """Create new Snapshot. - Delete a public IP that is part of the project. + 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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_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 @@ -6062,9 +6188,9 @@ 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._create_snapshot_serialize( project_id=project_id, - public_ip_id=public_ip_id, + create_snapshot_payload=create_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6072,7 +6198,7 @@ def delete_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -6087,15 +6213,13 @@ def delete_public_ip_with_http_info( ) @validate_call - def delete_public_ip_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."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], + create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6106,14 +6230,14 @@ 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. + """Create new Snapshot. - Delete a public IP that is part of the project. + 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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_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 @@ -6136,9 +6260,9 @@ 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._create_snapshot_serialize( project_id=project_id, - public_ip_id=public_ip_id, + create_snapshot_payload=create_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6146,7 +6270,7 @@ def delete_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -6156,10 +6280,10 @@ 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 _create_snapshot_serialize( self, project_id, - public_ip_id, + create_snapshot_payload, _request_auth, _content_type, _headers, @@ -6180,23 +6304,31 @@ def _delete_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 # 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="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/snapshots", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6210,20 +6342,18 @@ def _delete_public_ip_serialize( ) @validate_call - def delete_security_group( + def create_virtual_ip( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ + 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."), + ], + create_virtual_ip_payload: Annotated[ + CreateVirtualIPPayload, Field(description="Request a virtual IP creation.") ], _request_timeout: Union[ None, @@ -6234,15 +6364,17 @@ 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. + ) -> VirtualIp: + """Create new virtual IP. - Delete a security group. + Create a new virtual IP 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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param create_virtual_ip_payload: Request a virtual IP creation. (required) + :type create_virtual_ip_payload: CreateVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6265,9 +6397,10 @@ def delete_security_group( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_security_group_serialize( + _param = self._create_virtual_ip_serialize( project_id=project_id, - security_group_id=security_group_id, + network_id=network_id, + create_virtual_ip_payload=create_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6275,12 +6408,12 @@ def delete_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": "VirtualIp", "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) @@ -6291,20 +6424,18 @@ def delete_security_group( ).data @validate_call - def delete_security_group_with_http_info( + def create_virtual_ip_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - 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."), + ], + create_virtual_ip_payload: Annotated[ + CreateVirtualIPPayload, Field(description="Request a virtual IP creation.") ], _request_timeout: Union[ None, @@ -6315,15 +6446,17 @@ 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[VirtualIp]: + """Create new virtual IP. - Delete a security group. + Create a new virtual IP 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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param create_virtual_ip_payload: Request a virtual IP creation. (required) + :type create_virtual_ip_payload: CreateVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6346,9 +6479,10 @@ 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._create_virtual_ip_serialize( project_id=project_id, - security_group_id=security_group_id, + network_id=network_id, + create_virtual_ip_payload=create_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6356,12 +6490,12 @@ def delete_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": "VirtualIp", "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) @@ -6372,20 +6506,18 @@ def delete_security_group_with_http_info( ) @validate_call - def delete_security_group_without_preload_content( + def create_virtual_ip_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - 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."), + ], + create_virtual_ip_payload: Annotated[ + CreateVirtualIPPayload, Field(description="Request a virtual IP creation.") ], _request_timeout: Union[ None, @@ -6397,14 +6529,16 @@ 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. + """Create new virtual IP. - Delete a security group. + Create a new virtual IP 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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param create_virtual_ip_payload: Request a virtual IP creation. (required) + :type create_virtual_ip_payload: CreateVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6427,9 +6561,10 @@ 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._create_virtual_ip_serialize( project_id=project_id, - security_group_id=security_group_id, + network_id=network_id, + create_virtual_ip_payload=create_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6437,21 +6572,22 @@ def delete_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": "VirtualIp", "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 _delete_security_group_serialize( + def _create_virtual_ip_serialize( self, project_id, - security_group_id, + network_id, + create_virtual_ip_payload, _request_auth, _content_type, _headers, @@ -6472,23 +6608,33 @@ def _delete_security_group_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id + if 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_virtual_ip_payload is not None: + _body_params = create_virtual_ip_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="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6502,30 +6648,13 @@ def _delete_security_group_serialize( ) @validate_call - def delete_security_group_rule( + def create_volume( 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.", - ), - ], + create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6535,17 +6664,15 @@ 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. + ) -> Volume: + """Create new volume. - Delete a security group rule. + 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 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 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 @@ -6568,10 +6695,9 @@ 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._create_volume_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + create_volume_payload=create_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6579,7 +6705,7 @@ def delete_security_group_rule( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -6594,30 +6720,13 @@ def delete_security_group_rule( ).data @validate_call - def delete_security_group_rule_with_http_info( + def create_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."), ], - 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.", - ), - ], + create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6627,17 +6736,15 @@ 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[Volume]: + """Create new volume. - Delete a security group rule. + 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 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 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 @@ -6660,10 +6767,9 @@ 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._create_volume_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + create_volume_payload=create_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6671,7 +6777,7 @@ def delete_security_group_rule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -6686,30 +6792,13 @@ def delete_security_group_rule_with_http_info( ) @validate_call - def delete_security_group_rule_without_preload_content( + 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."), ], - 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.", - ), - ], + create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6720,16 +6809,14 @@ 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. + """Create new volume. - Delete a security group rule. + 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 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 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 @@ -6752,10 +6839,9 @@ 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._create_volume_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + create_volume_payload=create_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6763,7 +6849,7 @@ def delete_security_group_rule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -6773,11 +6859,10 @@ 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 _create_volume_serialize( self, project_id, - security_group_id, - security_group_rule_id, + create_volume_payload, _request_auth, _content_type, _headers, @@ -6798,25 +6883,31 @@ def _delete_security_group_rule_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id - if security_group_rule_id is not None: - _path_params["securityGroupRuleId"] = security_group_rule_id # 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="DELETE", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/volumes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6830,7 +6921,7 @@ def _delete_security_group_rule_serialize( ) @validate_call - def delete_server( + def deallocate_server( self, project_id: Annotated[ str, @@ -6850,9 +6941,9 @@ def delete_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete a server. + """Deallocate an existing server. - Delete a server. Volumes won't be deleted. + 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 @@ -6880,7 +6971,7 @@ def delete_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_server_serialize( + _param = self._deallocate_server_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -6890,11 +6981,12 @@ def delete_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) @@ -6905,7 +6997,7 @@ def delete_server( ).data @validate_call - def delete_server_with_http_info( + def deallocate_server_with_http_info( self, project_id: Annotated[ str, @@ -6925,9 +7017,9 @@ def delete_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete a server. + """Deallocate an existing server. - Delete a server. Volumes won't be deleted. + 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 @@ -6955,7 +7047,7 @@ 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._deallocate_server_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -6965,11 +7057,12 @@ def delete_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) @@ -6980,7 +7073,7 @@ def delete_server_with_http_info( ) @validate_call - def delete_server_without_preload_content( + def deallocate_server_without_preload_content( self, project_id: Annotated[ str, @@ -7000,9 +7093,9 @@ 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. + """Deallocate an existing server. - Delete a server. Volumes won't be deleted. + 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 @@ -7030,7 +7123,7 @@ 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._deallocate_server_serialize( project_id=project_id, server_id=server_id, _request_auth=_request_auth, @@ -7040,17 +7133,18 @@ def delete_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 _delete_server_serialize( + def _deallocate_server_serialize( self, project_id, server_id, @@ -7089,8 +7183,8 @@ def _delete_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7104,18 +7198,20 @@ def _delete_server_serialize( ) @validate_call - def delete_virtual_ip( + 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."), ], - network_id: Annotated[ + affinity_group_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity Group.", + ), ], _request_timeout: Union[ None, @@ -7127,16 +7223,14 @@ def delete_virtual_ip( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete a virtual IP. + """Delete a affinity group in a project. - Delete a virtual IP that is part of the 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str + :param 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 @@ -7159,10 +7253,9 @@ def delete_virtual_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_virtual_ip_serialize( + _param = self._delete_affinity_group_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + affinity_group_id=affinity_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7185,18 +7278,20 @@ def delete_virtual_ip( ).data @validate_call - def delete_virtual_ip_with_http_info( + 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."), ], - network_id: Annotated[ + affinity_group_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity Group.", + ), ], _request_timeout: Union[ None, @@ -7208,16 +7303,14 @@ def delete_virtual_ip_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete a virtual IP. + """Delete a affinity group in a project. - Delete a virtual IP that is part of the 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str + :param 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 @@ -7240,10 +7333,9 @@ def delete_virtual_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_virtual_ip_serialize( + _param = self._delete_affinity_group_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + affinity_group_id=affinity_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7266,18 +7358,20 @@ def delete_virtual_ip_with_http_info( ) @validate_call - def delete_virtual_ip_without_preload_content( + 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."), ], - network_id: Annotated[ + affinity_group_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity Group.", + ), ], _request_timeout: Union[ None, @@ -7289,16 +7383,14 @@ def delete_virtual_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a virtual IP. + """Delete a affinity group in a project. - Delete a virtual IP that is part of the 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str + :param 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 @@ -7321,10 +7413,9 @@ def delete_virtual_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_virtual_ip_serialize( + _param = self._delete_affinity_group_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + affinity_group_id=affinity_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7342,11 +7433,10 @@ def delete_virtual_ip_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_virtual_ip_serialize( + def _delete_affinity_group_serialize( self, project_id, - network_id, - virtual_ip_id, + affinity_group_id, _request_auth, _content_type, _headers, @@ -7367,10 +7457,8 @@ def _delete_virtual_ip_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - if virtual_ip_id is not None: - _path_params["virtualIpId"] = virtual_ip_id + if affinity_group_id is not None: + _path_params["affinityGroupId"] = affinity_group_id # process the query parameters # process the header parameters # process the form parameters @@ -7385,7 +7473,7 @@ def _delete_virtual_ip_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}", + resource_path="/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7399,16 +7487,17 @@ def _delete_virtual_ip_serialize( ) @validate_call - def delete_volume( + 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."), ], - 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."), ], + force: Annotated[Optional[StrictBool], Field(description="Force action.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7419,14 +7508,16 @@ def delete_volume( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete a volume. + """Delete a backup. - Delete a volume inside a project. The deletion will fail if the volume is still in use. + 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_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 @@ -7449,9 +7540,10 @@ def delete_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_volume_serialize( + _param = self._delete_backup_serialize( project_id=project_id, - volume_id=volume_id, + backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7464,7 +7556,6 @@ def delete_volume( "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7475,16 +7566,17 @@ def delete_volume( ).data @validate_call - def delete_volume_with_http_info( + 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."), ], - 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."), ], + force: Annotated[Optional[StrictBool], Field(description="Force action.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7495,14 +7587,16 @@ def delete_volume_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete a volume. + """Delete a backup. - Delete a volume inside a project. The deletion will fail if the volume is still in use. + 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_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 @@ -7525,9 +7619,10 @@ 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._delete_backup_serialize( project_id=project_id, - volume_id=volume_id, + backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7540,7 +7635,6 @@ def delete_volume_with_http_info( "401": "Error", "403": "Error", "404": "Error", - "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7551,16 +7645,17 @@ def delete_volume_with_http_info( ) @validate_call - def delete_volume_without_preload_content( + 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."), ], - 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."), ], + force: Annotated[Optional[StrictBool], Field(description="Force action.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7571,14 +7666,16 @@ 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. + """Delete a backup. - Delete a volume inside a project. The deletion will fail if the volume is still in use. + 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_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 @@ -7601,9 +7698,10 @@ 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._delete_backup_serialize( project_id=project_id, - volume_id=volume_id, + backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7616,16 +7714,16 @@ def delete_volume_without_preload_content( "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 _delete_backup_serialize( self, project_id, - volume_id, + backup_id, + force, _request_auth, _content_type, _headers, @@ -7646,9 +7744,13 @@ 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 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 @@ -7662,7 +7764,7 @@ def _delete_volume_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}", + resource_path="/v1alpha1/projects/{projectId}/backups/{backupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7676,19 +7778,14 @@ def _delete_volume_serialize( ) @validate_call - def get_attached_volume( + 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."), ], - 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."), + 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, @@ -7699,17 +7796,15 @@ 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. + ) -> None: + """Delete an Image. - Get the details of an existing Volume Attachment. + 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 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 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 @@ -7732,10 +7827,9 @@ def get_attached_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_attached_volume_serialize( + _param = self._delete_image_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7743,7 +7837,7 @@ def get_attached_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -7758,19 +7852,14 @@ def get_attached_volume( ).data @validate_call - def get_attached_volume_with_http_info( + 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."), ], - 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."), + 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, @@ -7781,17 +7870,15 @@ 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[None]: + """Delete an Image. - Get the details of an existing Volume Attachment. + 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 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 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 @@ -7814,10 +7901,9 @@ 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._delete_image_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7825,7 +7911,7 @@ def get_attached_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -7840,19 +7926,14 @@ def get_attached_volume_with_http_info( ) @validate_call - def get_attached_volume_without_preload_content( + 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."), ], - 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."), + 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, @@ -7864,16 +7945,14 @@ 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. + """Delete an Image. - Get the details of an existing Volume Attachment. + 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 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 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 @@ -7896,10 +7975,9 @@ 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._delete_image_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7907,7 +7985,7 @@ def get_attached_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -7917,11 +7995,10 @@ 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 _delete_image_serialize( self, project_id, - server_id, - volume_id, + image_id, _request_auth, _content_type, _headers, @@ -7942,10 +8019,8 @@ def _get_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 @@ -7959,8 +8034,8 @@ def _get_attached_volume_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7974,7 +8049,7 @@ def _get_attached_volume_serialize( ) @validate_call - def get_image( + def delete_image_share( self, project_id: Annotated[ str, @@ -7992,10 +8067,10 @@ def get_image( _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. + ) -> None: + """Remove image share. - Get details about a specific Image inside a project. + Remove the image share. New scope will be local. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -8023,7 +8098,7 @@ def get_image( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_image_serialize( + _param = self._delete_image_share_serialize( project_id=project_id, image_id=image_id, _request_auth=_request_auth, @@ -8033,7 +8108,7 @@ def get_image( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8048,7 +8123,7 @@ def get_image( ).data @validate_call - def get_image_with_http_info( + def delete_image_share_with_http_info( self, project_id: Annotated[ str, @@ -8066,10 +8141,10 @@ def get_image_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[Image]: - """Get details about an image. + ) -> ApiResponse[None]: + """Remove image share. - Get details about a specific Image inside a project. + Remove the image share. New scope will be local. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -8097,7 +8172,7 @@ def get_image_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_image_serialize( + _param = self._delete_image_share_serialize( project_id=project_id, image_id=image_id, _request_auth=_request_auth, @@ -8107,7 +8182,7 @@ def get_image_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8122,7 +8197,7 @@ def get_image_with_http_info( ) @validate_call - def get_image_without_preload_content( + def delete_image_share_without_preload_content( self, project_id: Annotated[ str, @@ -8141,9 +8216,9 @@ def get_image_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about an image. + """Remove image share. - Get details about a specific Image inside a project. + Remove the image share. New scope will be local. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str @@ -8171,7 +8246,7 @@ def get_image_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_image_serialize( + _param = self._delete_image_share_serialize( project_id=project_id, image_id=image_id, _request_auth=_request_auth, @@ -8181,7 +8256,7 @@ def get_image_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8191,7 +8266,7 @@ def get_image_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_image_serialize( + def _delete_image_share_serialize( self, project_id, image_id, @@ -8230,8 +8305,8 @@ def _get_image_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8245,9 +8320,24 @@ def _get_image_serialize( ) @validate_call - def get_key_pair( + def delete_image_share_consumer( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], + 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)], @@ -8257,13 +8347,17 @@ 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. + ) -> None: + """Remove an image share consumer. - Get details about an SSH keypair. + Remove consumer from a shared image. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param 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 @@ -8286,8 +8380,10 @@ def get_key_pair( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_key_pair_serialize( - keypair_name=keypair_name, + _param = self._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, @@ -8295,7 +8391,7 @@ def get_key_pair( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8310,9 +8406,24 @@ def get_key_pair( ).data @validate_call - def get_key_pair_with_http_info( + def delete_image_share_consumer_with_http_info( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], + 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)], @@ -8322,13 +8433,17 @@ 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[None]: + """Remove an image share consumer. - Get details about an SSH keypair. + Remove consumer from a shared image. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param 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 @@ -8351,8 +8466,10 @@ 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._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, @@ -8360,7 +8477,7 @@ def get_key_pair_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8375,9 +8492,24 @@ def get_key_pair_with_http_info( ) @validate_call - def get_key_pair_without_preload_content( + def delete_image_share_consumer_without_preload_content( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + ], + 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)], @@ -8388,12 +8520,16 @@ 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. + """Remove an image share consumer. - Get details about an SSH keypair. + Remove consumer from a shared image. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param image_id: The identifier (ID) of a STACKIT Image. (required) + :type image_id: str + :param 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 @@ -8416,8 +8552,10 @@ 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._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, @@ -8425,7 +8563,7 @@ def get_key_pair_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8435,9 +8573,11 @@ 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 _delete_image_share_consumer_serialize( self, - keypair_name, + project_id, + image_id, + consumer_project_id, _request_auth, _content_type, _headers, @@ -8456,8 +8596,12 @@ def _get_key_pair_serialize( _body_params: Optional[bytes] = None # process the path parameters - if keypair_name is not None: - _path_params["keypairName"] = keypair_name + if project_id is not None: + _path_params["projectId"] = project_id + if image_id is not None: + _path_params["imageId"] = image_id + 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 @@ -8471,8 +8615,8 @@ def _get_key_pair_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/keypairs/{keypairName}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8486,13 +8630,9 @@ def _get_key_pair_serialize( ) @validate_call - def get_machine_type( + def delete_key_pair( 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.")], + 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)], @@ -8502,15 +8642,13 @@ 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. + ) -> None: + """Delete an SSH keypair. - Get details about a specific machine type. + Delete an SSH keypair from a user. - :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 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 @@ -8533,9 +8671,8 @@ def get_machine_type( :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, + _param = self._delete_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8543,7 +8680,7 @@ def get_machine_type( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8558,13 +8695,9 @@ def get_machine_type( ).data @validate_call - def get_machine_type_with_http_info( + def delete_key_pair_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], + 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)], @@ -8574,15 +8707,13 @@ 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[None]: + """Delete an SSH keypair. - Get details about a specific machine type. + Delete an SSH keypair from a user. - :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 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 @@ -8605,9 +8736,8 @@ 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( - project_id=project_id, - machine_type=machine_type, + _param = self._delete_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8615,7 +8745,7 @@ def get_machine_type_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8630,13 +8760,9 @@ def get_machine_type_with_http_info( ) @validate_call - def get_machine_type_without_preload_content( + def delete_key_pair_without_preload_content( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], + 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)], @@ -8647,14 +8773,12 @@ 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. + """Delete an SSH keypair. - Get details about a specific machine type. + Delete an SSH keypair from a user. - :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 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 @@ -8677,9 +8801,8 @@ 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( - project_id=project_id, - machine_type=machine_type, + _param = self._delete_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8687,7 +8810,7 @@ def get_machine_type_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -8697,10 +8820,9 @@ 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 _delete_key_pair_serialize( self, - project_id, - machine_type, + keypair_name, _request_auth, _content_type, _headers, @@ -8719,10 +8841,8 @@ def _get_machine_type_serialize( _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 + if keypair_name is not None: + _path_params["keypairName"] = keypair_name # process the query parameters # process the header parameters # process the form parameters @@ -8736,8 +8856,8 @@ def _get_machine_type_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/machine-types/{machineType}", + method="DELETE", + resource_path="/v1alpha1/keypairs/{keypairName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8751,7 +8871,7 @@ def _get_machine_type_serialize( ) @validate_call - def get_network( + def delete_network( self, project_id: Annotated[ str, @@ -8770,10 +8890,10 @@ 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. + ) -> None: + """Delete network. - Get details about a network of a project. + 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 @@ -8801,7 +8921,7 @@ def get_network( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_serialize( + _param = self._delete_network_serialize( project_id=project_id, network_id=network_id, _request_auth=_request_auth, @@ -8811,11 +8931,12 @@ def get_network( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "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) @@ -8826,7 +8947,7 @@ def get_network( ).data @validate_call - def get_network_with_http_info( + def delete_network_with_http_info( self, project_id: Annotated[ str, @@ -8845,10 +8966,10 @@ 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[None]: + """Delete network. - Get details about a network of a project. + 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 @@ -8876,7 +8997,7 @@ 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._delete_network_serialize( project_id=project_id, network_id=network_id, _request_auth=_request_auth, @@ -8886,11 +9007,12 @@ def get_network_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "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) @@ -8901,7 +9023,7 @@ def get_network_with_http_info( ) @validate_call - def get_network_without_preload_content( + def delete_network_without_preload_content( self, project_id: Annotated[ str, @@ -8921,9 +9043,9 @@ 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. + """Delete network. - Get details about a network of a project. + 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 @@ -8951,7 +9073,7 @@ 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._delete_network_serialize( project_id=project_id, network_id=network_id, _request_auth=_request_auth, @@ -8961,17 +9083,18 @@ def get_network_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", + "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 _get_network_serialize( + def _delete_network_serialize( self, project_id, network_id, @@ -9010,7 +9133,7 @@ def _get_network_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", + method="DELETE", resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}", path_params=_path_params, query_params=_query_params, @@ -9025,7 +9148,7 @@ def _get_network_serialize( ) @validate_call - def get_network_area( + def delete_network_area( self, organization_id: Annotated[ str, @@ -9048,10 +9171,10 @@ 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. + ) -> None: + """Delete a network area. - Get details about a network area in an organization. + 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 @@ -9079,7 +9202,7 @@ def get_network_area( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_serialize( + _param = self._delete_network_area_serialize( organization_id=organization_id, area_id=area_id, _request_auth=_request_auth, @@ -9089,11 +9212,12 @@ def get_network_area( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "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) @@ -9104,7 +9228,7 @@ def get_network_area( ).data @validate_call - def get_network_area_with_http_info( + def delete_network_area_with_http_info( self, organization_id: Annotated[ str, @@ -9127,10 +9251,10 @@ 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[None]: + """Delete a network area. - Get details about a network area in an organization. + 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 @@ -9158,7 +9282,7 @@ def get_network_area_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_network_area_serialize( + _param = self._delete_network_area_serialize( organization_id=organization_id, area_id=area_id, _request_auth=_request_auth, @@ -9168,11 +9292,12 @@ def get_network_area_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "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) @@ -9183,7 +9308,7 @@ def get_network_area_with_http_info( ) @validate_call - def get_network_area_without_preload_content( + def delete_network_area_without_preload_content( self, organization_id: Annotated[ str, @@ -9207,9 +9332,9 @@ 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. + """Delete a network area. - Get details about a network area in an organization. + 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 @@ -9237,7 +9362,7 @@ 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( + _param = self._delete_network_area_serialize( organization_id=organization_id, area_id=area_id, _request_auth=_request_auth, @@ -9247,17 +9372,18 @@ def get_network_area_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", + "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 _get_network_area_serialize( + def _delete_network_area_serialize( self, organization_id, area_id, @@ -9296,7 +9422,7 @@ def _get_network_area_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", + method="DELETE", resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}", path_params=_path_params, query_params=_query_params, @@ -9311,19 +9437,25 @@ def _get_network_area_serialize( ) @validate_call - def get_nic( + def delete_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." + ), ], - network_id: Annotated[ + area_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 Network Area." + ), ], - nic_id: Annotated[ + network_range_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 Network Range." + ), ], _request_timeout: Union[ None, @@ -9334,17 +9466,17 @@ 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. + ) -> None: + """Delete a network range. - Get details about a network interface inside a network. + Delete a network range of a network area. The deletion will fail if the network range is still used. - :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 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 @@ -9367,10 +9499,10 @@ def get_nic( :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, + _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, @@ -9378,11 +9510,12 @@ def get_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "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) @@ -9393,19 +9526,25 @@ def get_nic( ).data @validate_call - def get_nic_with_http_info( + def delete_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." + ), ], - network_id: Annotated[ + area_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 Network Area." + ), ], - nic_id: Annotated[ + network_range_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 Network Range." + ), ], _request_timeout: Union[ None, @@ -9416,17 +9555,17 @@ 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[None]: + """Delete a network range. - Get details about a network interface inside a network. + Delete a network range of a network area. The deletion will fail if the network range is still used. - :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 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 @@ -9449,10 +9588,10 @@ def get_nic_with_http_info( :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, + _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, @@ -9460,11 +9599,12 @@ def get_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "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) @@ -9475,19 +9615,25 @@ def get_nic_with_http_info( ) @validate_call - def get_nic_without_preload_content( + def delete_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." + ), ], - network_id: Annotated[ + area_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 Network Area." + ), ], - nic_id: Annotated[ + network_range_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 Network Range." + ), ], _request_timeout: Union[ None, @@ -9499,16 +9645,16 @@ 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. + """Delete a network range. - Get details about a network interface inside a network. + Delete a network range of a network area. The deletion will fail if the network range is still used. - :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 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 @@ -9531,10 +9677,10 @@ def get_nic_without_preload_content( :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, + _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, @@ -9542,21 +9688,22 @@ def get_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "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 _get_nic_serialize( + def _delete_network_area_range_serialize( self, - project_id, - network_id, - nic_id, + organization_id, + area_id, + network_range_id, _request_auth, _content_type, _headers, @@ -9575,12 +9722,12 @@ def _get_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 nic_id is not None: - _path_params["nicId"] = nic_id + 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 @@ -9594,8 +9741,8 @@ def _get_nic_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + method="DELETE", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9609,7 +9756,7 @@ def _get_nic_serialize( ) @validate_call - def get_organization_request( + def delete_network_area_route( self, organization_id: Annotated[ str, @@ -9617,9 +9764,14 @@ def get_organization_request( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + 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, @@ -9630,15 +9782,17 @@ 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. + ) -> None: + """Delete a network route. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Delete a network route of a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param 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 @@ -9661,9 +9815,10 @@ def get_organization_request( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._delete_network_area_route_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9671,7 +9826,7 @@ def get_organization_request( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -9686,7 +9841,7 @@ def get_organization_request( ).data @validate_call - def get_organization_request_with_http_info( + def delete_network_area_route_with_http_info( self, organization_id: Annotated[ str, @@ -9694,9 +9849,14 @@ def get_organization_request_with_http_info( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + 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, @@ -9707,15 +9867,17 @@ 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[None]: + """Delete a network route. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Delete a network route of a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param 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 @@ -9738,9 +9900,10 @@ def get_organization_request_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._delete_network_area_route_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9748,7 +9911,7 @@ def get_organization_request_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -9763,7 +9926,7 @@ def get_organization_request_with_http_info( ) @validate_call - def get_organization_request_without_preload_content( + def delete_network_area_route_without_preload_content( self, organization_id: Annotated[ str, @@ -9771,9 +9934,14 @@ def get_organization_request_without_preload_content( min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." ), ], - request_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), + ], + 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, @@ -9785,14 +9953,16 @@ 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. + """Delete a network route. - Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + Delete a network route of a network area. :param organization_id: The identifier (ID) of a STACKIT Organization. (required) :type organization_id: str - :param request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_id: str + :param area_id: The identifier (ID) of a STACKIT Network Area. (required) + :type area_id: str + :param 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 @@ -9815,9 +9985,10 @@ def get_organization_request_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_organization_request_serialize( + _param = self._delete_network_area_route_serialize( organization_id=organization_id, - request_id=request_id, + area_id=area_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9825,7 +9996,7 @@ def get_organization_request_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -9835,10 +10006,11 @@ 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 _delete_network_area_route_serialize( self, organization_id, - request_id, + area_id, + route_id, _request_auth, _content_type, _headers, @@ -9859,8 +10031,10 @@ def _get_organization_request_serialize( # process the path parameters if organization_id is not None: _path_params["organizationId"] = organization_id - if request_id is not None: - _path_params["requestId"] = request_id + if area_id is not None: + _path_params["areaId"] = area_id + if route_id is not None: + _path_params["routeId"] = route_id # process the query parameters # process the header parameters # process the form parameters @@ -9874,8 +10048,8 @@ def _get_organization_request_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/organizations/{organizationId}/requests/{requestId}", + method="DELETE", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9889,28 +10063,40 @@ def _get_organization_request_serialize( ) @validate_call - def get_project_details( + 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."), ], - _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, + 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, - ) -> Project: - """Get project details. + ) -> None: + """Delete a network interface. - Get details about a STACKIT project. + 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 @@ -9933,8 +10119,10 @@ def get_project_details( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_details_serialize( + _param = self._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, @@ -9942,7 +10130,7 @@ def get_project_details( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Project", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -9957,12 +10145,20 @@ def get_project_details( ).data @validate_call - def get_project_details_with_http_info( + 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)], @@ -9972,13 +10168,17 @@ def get_project_details_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Project]: - """Get project details. + ) -> ApiResponse[None]: + """Delete a network interface. - Get details about a STACKIT project. + 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 @@ -10001,8 +10201,10 @@ def get_project_details_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_details_serialize( + _param = self._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, @@ -10010,7 +10212,7 @@ def get_project_details_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Project", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -10025,12 +10227,20 @@ def get_project_details_with_http_info( ) @validate_call - def get_project_details_without_preload_content( + 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)], @@ -10041,12 +10251,16 @@ def get_project_details_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get project details. + """Delete a network interface. - Get details about a STACKIT project. + 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 @@ -10069,8 +10283,10 @@ def get_project_details_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_details_serialize( + _param = self._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, @@ -10078,7 +10294,7 @@ def get_project_details_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Project", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -10088,9 +10304,11 @@ def get_project_details_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_project_details_serialize( + def _delete_nic_serialize( self, project_id, + network_id, + nic_id, _request_auth, _content_type, _headers, @@ -10111,6 +10329,10 @@ def _get_project_details_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if network_id is not None: + _path_params["networkId"] = network_id + if nic_id is not None: + _path_params["nicId"] = nic_id # process the query parameters # process the header parameters # process the form parameters @@ -10124,8 +10346,8 @@ def _get_project_details_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10139,15 +10361,14 @@ def _get_project_details_serialize( ) @validate_call - def get_project_request( + 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."), ], - request_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + 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, @@ -10158,15 +10379,15 @@ 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. + ) -> None: + """Delete a public IP. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + 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 request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_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 @@ -10189,9 +10410,9 @@ def get_project_request( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_project_request_serialize( + _param = self._delete_public_ip_serialize( project_id=project_id, - request_id=request_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10199,7 +10420,7 @@ def get_project_request( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -10214,15 +10435,14 @@ def get_project_request( ).data @validate_call - def get_project_request_with_http_info( + 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."), ], - request_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + 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, @@ -10233,15 +10453,15 @@ 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[None]: + """Delete a public IP. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + 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 request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_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 @@ -10264,9 +10484,9 @@ 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( + _param = self._delete_public_ip_serialize( project_id=project_id, - request_id=request_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10274,7 +10494,7 @@ def get_project_request_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -10289,15 +10509,14 @@ def get_project_request_with_http_info( ) @validate_call - def get_project_request_without_preload_content( + 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."), ], - request_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + 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, @@ -10309,14 +10528,14 @@ 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. + """Delete a public IP. - Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + 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 request_id: The identifier (ID) of a STACKIT Request. (required) - :type request_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 @@ -10339,9 +10558,9 @@ 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( + _param = self._delete_public_ip_serialize( project_id=project_id, - request_id=request_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10349,7 +10568,7 @@ def get_project_request_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Request", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -10359,10 +10578,10 @@ 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 _delete_public_ip_serialize( self, project_id, - request_id, + public_ip_id, _request_auth, _content_type, _headers, @@ -10383,8 +10602,8 @@ def _get_project_request_serialize( # 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 + 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 @@ -10398,8 +10617,8 @@ def _get_project_request_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/requests/{requestId}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10413,14 +10632,20 @@ def _get_project_request_serialize( ) @validate_call - def get_public_ip( + 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."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + 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, @@ -10431,15 +10656,15 @@ 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. + ) -> None: + """Delete security group. - Get details about a public IP inside a project. + Delete a security group. :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 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 @@ -10462,9 +10687,9 @@ def get_public_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_public_ip_serialize( + _param = self._delete_security_group_serialize( project_id=project_id, - public_ip_id=public_ip_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10472,11 +10697,12 @@ def get_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "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) @@ -10487,14 +10713,20 @@ def get_public_ip( ).data @validate_call - def get_public_ip_with_http_info( + 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."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + 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, @@ -10505,15 +10737,15 @@ 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[None]: + """Delete security group. - Get details about a public IP inside a project. + Delete a security group. :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 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 @@ -10536,9 +10768,9 @@ 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._delete_security_group_serialize( project_id=project_id, - public_ip_id=public_ip_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10546,11 +10778,12 @@ def get_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "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) @@ -10561,14 +10794,20 @@ def get_public_ip_with_http_info( ) @validate_call - def get_public_ip_without_preload_content( + 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."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + 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, @@ -10580,14 +10819,14 @@ 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. + """Delete security group. - Get details about a public IP inside a project. + Delete a security group. :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 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 @@ -10610,9 +10849,9 @@ 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._delete_security_group_serialize( project_id=project_id, - public_ip_id=public_ip_id, + security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10620,20 +10859,21 @@ def get_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "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 _get_public_ip_serialize( + def _delete_security_group_serialize( self, project_id, - public_ip_id, + security_group_id, _request_auth, _content_type, _headers, @@ -10654,8 +10894,8 @@ 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 + 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 @@ -10669,8 +10909,8 @@ def _get_public_ip_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10684,7 +10924,7 @@ def _get_public_ip_serialize( ) @validate_call - def get_security_group( + def delete_security_group_rule( self, project_id: Annotated[ str, @@ -10699,6 +10939,15 @@ def get_security_group( 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)], @@ -10708,15 +10957,17 @@ 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. + ) -> None: + """Delete security group rule. - Get details about a security group of a project. + 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 @@ -10739,9 +10990,10 @@ def get_security_group( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _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, @@ -10749,7 +11001,7 @@ def get_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -10764,7 +11016,7 @@ def get_security_group( ).data @validate_call - def get_security_group_with_http_info( + def delete_security_group_rule_with_http_info( self, project_id: Annotated[ str, @@ -10779,6 +11031,15 @@ def get_security_group_with_http_info( 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)], @@ -10788,15 +11049,17 @@ 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[None]: + """Delete security group rule. - Get details about a security group of a project. + 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 @@ -10819,9 +11082,10 @@ def get_security_group_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _param = self._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, @@ -10829,7 +11093,7 @@ def get_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -10844,7 +11108,7 @@ def get_security_group_with_http_info( ) @validate_call - def get_security_group_without_preload_content( + def delete_security_group_rule_without_preload_content( self, project_id: Annotated[ str, @@ -10859,6 +11123,15 @@ def get_security_group_without_preload_content( 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)], @@ -10869,14 +11142,16 @@ 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. + """Delete security group rule. - Get details about a security group of a project. + 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 @@ -10899,9 +11174,10 @@ def get_security_group_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_serialize( + _param = self._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, @@ -10909,7 +11185,7 @@ def get_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -10919,10 +11195,11 @@ 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 _delete_security_group_rule_serialize( self, project_id, security_group_id, + security_group_rule_id, _request_auth, _content_type, _headers, @@ -10945,6 +11222,8 @@ def _get_security_group_serialize( _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 @@ -10958,8 +11237,8 @@ def _get_security_group_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10973,29 +11252,15 @@ def _get_security_group_serialize( ) @validate_call - def get_security_group_rule( + 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."), ], - 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[ + server_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -11006,17 +11271,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. + ) -> None: + """Delete a server. - Get details about a security group rule of a project. + Delete a server. Volumes won't be deleted. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11039,10 +11302,9 @@ def get_security_group_rule( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._delete_server_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11050,7 +11312,7 @@ def get_security_group_rule( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11065,29 +11327,15 @@ def get_security_group_rule( ).data @validate_call - def get_security_group_rule_with_http_info( + 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."), ], - 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[ + server_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -11098,17 +11346,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[None]: + """Delete a server. - Get details about a security group rule of a project. + Delete a server. Volumes won't be deleted. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11131,10 +11377,9 @@ def get_security_group_rule_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._delete_server_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11142,7 +11387,7 @@ def get_security_group_rule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11157,29 +11402,15 @@ def get_security_group_rule_with_http_info( ) @validate_call - def get_security_group_rule_without_preload_content( + 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."), ], - 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[ + server_id: Annotated[ str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], _request_timeout: Union[ None, @@ -11191,16 +11422,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. + """Delete a server. - Get details about a security group rule of a project. + Delete a server. Volumes won't be deleted. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11223,10 +11452,9 @@ def get_security_group_rule_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_security_group_rule_serialize( + _param = self._delete_server_serialize( project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, + server_id=server_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11234,7 +11462,7 @@ def get_security_group_rule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRule", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11244,11 +11472,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 _delete_server_serialize( self, project_id, - security_group_id, - security_group_rule_id, + server_id, _request_auth, _content_type, _headers, @@ -11269,10 +11496,8 @@ def _get_security_group_rule_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id - if security_group_rule_id is not None: - _path_params["securityGroupRuleId"] = security_group_rule_id + if server_id is not None: + _path_params["serverId"] = server_id # process the query parameters # process the header parameters # process the form parameters @@ -11286,8 +11511,8 @@ def _get_security_group_rule_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11301,17 +11526,16 @@ def _get_security_group_rule_serialize( ) @validate_call - def get_server( + 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."), ], - server_id: Annotated[ + snapshot_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 Snapshot."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11321,17 +11545,15 @@ 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. + ) -> None: + """Delete a snapshot. - Get details about a server by its ID. + 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 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 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 @@ -11354,10 +11576,9 @@ def get_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._delete_snapshot_serialize( project_id=project_id, - server_id=server_id, - details=details, + snapshot_id=snapshot_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11365,7 +11586,7 @@ def get_server( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11380,17 +11601,16 @@ def get_server( ).data @validate_call - def get_server_with_http_info( + 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."), ], - server_id: Annotated[ + snapshot_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 Snapshot."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11400,17 +11620,15 @@ 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[None]: + """Delete a snapshot. - Get details about a server by its ID. + 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 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 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 @@ -11433,10 +11651,9 @@ def get_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._delete_snapshot_serialize( project_id=project_id, - server_id=server_id, - details=details, + snapshot_id=snapshot_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11444,7 +11661,7 @@ def get_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11459,17 +11676,16 @@ def get_server_with_http_info( ) @validate_call - def get_server_without_preload_content( + 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."), ], - server_id: Annotated[ + snapshot_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 Snapshot."), ], - details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11480,16 +11696,14 @@ 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. + """Delete a snapshot. - Get details about a server by its ID. + 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 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 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 @@ -11512,10 +11726,9 @@ def get_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_serialize( + _param = self._delete_snapshot_serialize( project_id=project_id, - server_id=server_id, - details=details, + snapshot_id=snapshot_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11523,7 +11736,7 @@ def get_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11533,11 +11746,10 @@ 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 _delete_snapshot_serialize( self, project_id, - server_id, - details, + snapshot_id, _request_auth, _content_type, _headers, @@ -11558,13 +11770,9 @@ def _get_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 snapshot_id is not None: + _path_params["snapshotId"] = snapshot_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 @@ -11577,8 +11785,8 @@ def _get_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/snapshots/{snapshotId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11592,15 +11800,18 @@ def _get_server_serialize( ) @validate_call - def get_server_console( + def delete_virtual_ip( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") ], _request_timeout: Union[ None, @@ -11611,15 +11822,17 @@ def get_server_console( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServerConsoleUrl: - """Get server console. + ) -> None: + """Delete a virtual IP. - Get a URL for server remote console. + Delete a virtual IP that is part of the project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11642,9 +11855,10 @@ def get_server_console( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._delete_virtual_ip_serialize( project_id=project_id, - server_id=server_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11652,7 +11866,7 @@ def get_server_console( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11667,15 +11881,18 @@ def get_server_console( ).data @validate_call - def get_server_console_with_http_info( + def delete_virtual_ip_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") ], _request_timeout: Union[ None, @@ -11686,15 +11903,17 @@ def get_server_console_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ServerConsoleUrl]: - """Get server console. + ) -> ApiResponse[None]: + """Delete a virtual IP. - Get a URL for server remote console. + Delete a virtual IP that is part of the project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11717,9 +11936,10 @@ def get_server_console_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._delete_virtual_ip_serialize( project_id=project_id, - server_id=server_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11727,7 +11947,7 @@ def get_server_console_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11742,15 +11962,18 @@ def get_server_console_with_http_info( ) @validate_call - def get_server_console_without_preload_content( + def delete_virtual_ip_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") ], _request_timeout: Union[ None, @@ -11762,14 +11985,16 @@ def get_server_console_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get server console. + """Delete a virtual IP. - Get a URL for server remote console. + Delete a virtual IP that is part of the project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11792,9 +12017,10 @@ def get_server_console_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_server_console_serialize( + _param = self._delete_virtual_ip_serialize( project_id=project_id, - server_id=server_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11802,7 +12028,7 @@ def get_server_console_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerConsoleUrl", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -11812,10 +12038,11 @@ def get_server_console_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_server_console_serialize( + def _delete_virtual_ip_serialize( self, project_id, - server_id, + network_id, + virtual_ip_id, _request_auth, _content_type, _headers, @@ -11836,8 +12063,10 @@ def _get_server_console_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id + if network_id is not None: + _path_params["networkId"] = network_id + if virtual_ip_id is not None: + _path_params["virtualIpId"] = virtual_ip_id # process the query parameters # process the header parameters # process the form parameters @@ -11851,8 +12080,8 @@ def _get_server_console_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/console", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11866,20 +12095,16 @@ def _get_server_console_serialize( ) @validate_call - def get_server_log( + 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."), ], - server_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11889,17 +12114,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. + ) -> None: + """Delete a volume. - Get server console log. + 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 server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11922,10 +12145,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._delete_volume_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11933,11 +12155,12 @@ def get_server_log( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "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) @@ -11948,20 +12171,16 @@ def get_server_log( ).data @validate_call - def get_server_log_with_http_info( + 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."), ], - server_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11971,17 +12190,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[None]: + """Delete a volume. - Get server console log. + 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 server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12004,10 +12221,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._delete_volume_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12015,11 +12231,12 @@ def get_server_log_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "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) @@ -12030,20 +12247,16 @@ def get_server_log_with_http_info( ) @validate_call - def get_server_log_without_preload_content( + 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."), ], - server_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], - get_server_log_request: Annotated[ - Optional[GetServerLogRequest], - Field(description="Request the server log. By default the length is limited to 2000 lines."), - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12054,16 +12267,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. + """Delete a volume. - Get server console log. + 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 server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param get_server_log_request: Request the server log. By default the length is limited to 2000 lines. - :type get_server_log_request: GetServerLogRequest + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12086,10 +12297,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._delete_volume_serialize( project_id=project_id, - server_id=server_id, - get_server_log_request=get_server_log_request, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12097,21 +12307,21 @@ def get_server_log_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetServerLog200Response", + "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 _get_server_log_serialize( + def _delete_volume_serialize( self, project_id, - server_id, - get_server_log_request, + volume_id, _request_auth, _content_type, _headers, @@ -12132,33 +12342,23 @@ def _get_server_log_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id + if volume_id is not None: + _path_params["volumeId"] = volume_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if get_server_log_request is not None: - _body_params = get_server_log_request # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/log", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12172,18 +12372,20 @@ def _get_server_log_serialize( ) @validate_call - def get_virtual_ip( + 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."), ], - network_id: Annotated[ + affinity_group_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity Group.", + ), ], _request_timeout: Union[ None, @@ -12194,17 +12396,15 @@ def get_virtual_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VirtualIp: - """Get details about a virtual IP. + ) -> AffinityGroup: + """Get the affinity group. - Get details about a virtual IP inside a project. + Get the affinity group created 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 virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_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 @@ -12227,10 +12427,9 @@ def get_virtual_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_virtual_ip_serialize( + _param = self._get_affinity_group_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + affinity_group_id=affinity_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12238,7 +12437,7 @@ def get_virtual_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "200": "AffinityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -12253,18 +12452,20 @@ def get_virtual_ip( ).data @validate_call - def get_virtual_ip_with_http_info( + 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."), ], - network_id: Annotated[ + affinity_group_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity Group.", + ), ], _request_timeout: Union[ None, @@ -12275,17 +12476,15 @@ def get_virtual_ip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VirtualIp]: - """Get details about a virtual IP. + ) -> ApiResponse[AffinityGroup]: + """Get the affinity group. - Get details about a virtual IP inside a project. + Get the affinity group created 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 virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_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 @@ -12308,10 +12507,9 @@ def get_virtual_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_virtual_ip_serialize( + _param = self._get_affinity_group_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + affinity_group_id=affinity_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12319,7 +12517,7 @@ def get_virtual_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "200": "AffinityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -12334,18 +12532,20 @@ def get_virtual_ip_with_http_info( ) @validate_call - def get_virtual_ip_without_preload_content( + 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."), ], - network_id: Annotated[ + affinity_group_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Affinity Group.", + ), ], _request_timeout: Union[ None, @@ -12357,16 +12557,14 @@ def get_virtual_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a virtual IP. + """Get the affinity group. - Get details about a virtual IP inside a project. + Get the affinity group created 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 virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_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 @@ -12389,10 +12587,9 @@ def get_virtual_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_virtual_ip_serialize( + _param = self._get_affinity_group_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, + affinity_group_id=affinity_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12400,7 +12597,7 @@ def get_virtual_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "200": "AffinityGroup", "400": "Error", "401": "Error", "403": "Error", @@ -12410,11 +12607,10 @@ def get_virtual_ip_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_virtual_ip_serialize( + def _get_affinity_group_serialize( self, project_id, - network_id, - virtual_ip_id, + affinity_group_id, _request_auth, _content_type, _headers, @@ -12435,10 +12631,8 @@ def _get_virtual_ip_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - if virtual_ip_id is not None: - _path_params["virtualIpId"] = virtual_ip_id + if affinity_group_id is not None: + _path_params["affinityGroupId"] = affinity_group_id # process the query parameters # process the header parameters # process the form parameters @@ -12453,7 +12647,7 @@ def _get_virtual_ip_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}", + resource_path="/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12467,12 +12661,16 @@ def _get_virtual_ip_serialize( ) @validate_call - def get_volume( + 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."), @@ -12486,13 +12684,15 @@ def get_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Volume: - """Get details about a volume. + ) -> VolumeAttachment: + """Get Volume Attachment details. - Get details about a block device volume. + 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 @@ -12517,8 +12717,9 @@ def get_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _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, @@ -12527,7 +12728,7 @@ def get_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "VolumeAttachment", "400": "Error", "401": "Error", "403": "Error", @@ -12542,12 +12743,16 @@ def get_volume( ).data @validate_call - def get_volume_with_http_info( + 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."), @@ -12561,13 +12766,15 @@ def get_volume_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Volume]: - """Get details about a volume. + ) -> ApiResponse[VolumeAttachment]: + """Get Volume Attachment details. - Get details about a block device volume. + 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 @@ -12592,8 +12799,9 @@ def get_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._get_attached_volume_serialize( project_id=project_id, + server_id=server_id, volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, @@ -12602,7 +12810,7 @@ def get_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "VolumeAttachment", "400": "Error", "401": "Error", "403": "Error", @@ -12617,12 +12825,16 @@ def get_volume_with_http_info( ) @validate_call - def get_volume_without_preload_content( + 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."), @@ -12637,12 +12849,14 @@ def get_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get details about a volume. + """Get Volume Attachment details. - Get details about a block device volume. + 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 @@ -12667,8 +12881,9 @@ def get_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_volume_serialize( + _param = self._get_attached_volume_serialize( project_id=project_id, + server_id=server_id, volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, @@ -12677,7 +12892,7 @@ def get_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "VolumeAttachment", "400": "Error", "401": "Error", "403": "Error", @@ -12687,9 +12902,10 @@ def get_volume_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_volume_serialize( + def _get_attached_volume_serialize( self, project_id, + server_id, volume_id, _request_auth, _content_type, @@ -12711,6 +12927,8 @@ def _get_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 # process the query parameters @@ -12727,7 +12945,7 @@ def _get_volume_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12741,14 +12959,15 @@ def _get_volume_serialize( ) @validate_call - def get_volume_performance_class( + 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."), ], - volume_performance_class: Annotated[ - str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") + 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, @@ -12759,15 +12978,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. + ) -> Backup: + """Get details about a backup. - Get details about a specific volume performance class. + Get details about a block device backup. :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 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 @@ -12790,9 +13009,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._get_backup_serialize( project_id=project_id, - volume_performance_class=volume_performance_class, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12800,7 +13019,7 @@ def get_volume_performance_class( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "Backup", "400": "Error", "401": "Error", "403": "Error", @@ -12815,14 +13034,15 @@ def get_volume_performance_class( ).data @validate_call - def get_volume_performance_class_with_http_info( + 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."), ], - volume_performance_class: Annotated[ - str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") + 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, @@ -12833,15 +13053,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[Backup]: + """Get details about a backup. - Get details about a specific volume performance class. + Get details about a block device backup. :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 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 @@ -12864,9 +13084,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._get_backup_serialize( project_id=project_id, - volume_performance_class=volume_performance_class, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12874,7 +13094,7 @@ def get_volume_performance_class_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "Backup", "400": "Error", "401": "Error", "403": "Error", @@ -12889,14 +13109,15 @@ def get_volume_performance_class_with_http_info( ) @validate_call - def get_volume_performance_class_without_preload_content( + 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."), ], - volume_performance_class: Annotated[ - str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") + 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, @@ -12908,14 +13129,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. + """Get details about a backup. - Get details about a specific volume performance class. + Get details about a block device backup. :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 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 @@ -12938,9 +13159,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._get_backup_serialize( project_id=project_id, - volume_performance_class=volume_performance_class, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12948,7 +13169,7 @@ def get_volume_performance_class_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClass", + "200": "Backup", "400": "Error", "401": "Error", "403": "Error", @@ -12958,10 +13179,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 _get_backup_serialize( self, project_id, - volume_performance_class, + backup_id, _request_auth, _content_type, _headers, @@ -12982,8 +13203,8 @@ 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 + if backup_id is not None: + _path_params["backupId"] = backup_id # process the query parameters # process the header parameters # process the form parameters @@ -12998,7 +13219,7 @@ def _get_volume_performance_class_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}", + resource_path="/v1alpha1/projects/{projectId}/backups/{backupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13012,15 +13233,14 @@ def _get_volume_performance_class_serialize( ) @validate_call - def list_attached_volumes( + 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."), ], - 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, @@ -13031,15 +13251,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. + ) -> Image: + """Get details about an image. - Get a list of all volume attachments of a server. + 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 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 @@ -13062,9 +13282,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._get_image_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13072,7 +13292,7 @@ def list_attached_volumes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "Image", "400": "Error", "401": "Error", "403": "Error", @@ -13087,15 +13307,14 @@ def list_attached_volumes( ).data @validate_call - def list_attached_volumes_with_http_info( + 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."), ], - 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, @@ -13106,15 +13325,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[Image]: + """Get details about an image. - Get a list of all volume attachments of a server. + 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 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 @@ -13137,9 +13356,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._get_image_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13147,7 +13366,7 @@ def list_attached_volumes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "Image", "400": "Error", "401": "Error", "403": "Error", @@ -13162,15 +13381,14 @@ def list_attached_volumes_with_http_info( ) @validate_call - def list_attached_volumes_without_preload_content( + 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."), ], - 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, @@ -13182,14 +13400,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. + """Get details about an image. - Get a list of all volume attachments of a server. + 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 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 @@ -13212,9 +13430,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._get_image_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13222,7 +13440,7 @@ def list_attached_volumes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachmentListResponse", + "200": "Image", "400": "Error", "401": "Error", "403": "Error", @@ -13232,10 +13450,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 _get_image_serialize( self, project_id, - server_id, + image_id, _request_auth, _content_type, _headers, @@ -13256,8 +13474,8 @@ 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 + if image_id is not None: + _path_params["imageId"] = image_id # process the query parameters # process the header parameters # process the form parameters @@ -13272,7 +13490,7 @@ def _list_attached_volumes_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13286,13 +13504,15 @@ def _list_attached_volumes_serialize( ) @validate_call - def list_images( + 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."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + 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)], @@ -13302,15 +13522,15 @@ def list_images( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageListResponse: - """List all Images inside a project. + ) -> ImageShare: + """Get share details of an image. - Get a list of all images inside a project. + Get share details about an shared image. :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 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 @@ -13333,9 +13553,9 @@ def list_images( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_images_serialize( + _param = self._get_image_share_serialize( project_id=project_id, - label_selector=label_selector, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13343,7 +13563,7 @@ def list_images( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageListResponse", + "200": "ImageShare", "400": "Error", "401": "Error", "403": "Error", @@ -13358,13 +13578,15 @@ def list_images( ).data @validate_call - def list_images_with_http_info( + 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."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + 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)], @@ -13374,15 +13596,15 @@ def list_images_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[ImageListResponse]: - """List all Images inside a project. + ) -> ApiResponse[ImageShare]: + """Get share details of an image. - Get a list of all images inside a project. + Get share details about an shared image. :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 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 @@ -13405,9 +13627,9 @@ def list_images_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_images_serialize( + _param = self._get_image_share_serialize( project_id=project_id, - label_selector=label_selector, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13415,7 +13637,7 @@ def list_images_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageListResponse", + "200": "ImageShare", "400": "Error", "401": "Error", "403": "Error", @@ -13430,13 +13652,15 @@ def list_images_with_http_info( ) @validate_call - def list_images_without_preload_content( + 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."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + 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)], @@ -13447,14 +13671,14 @@ def list_images_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all Images inside a project. + """Get share details of an image. - Get a list of all images inside a project. + Get share details about an shared image. :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 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 @@ -13477,9 +13701,9 @@ def list_images_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_images_serialize( + _param = self._get_image_share_serialize( project_id=project_id, - label_selector=label_selector, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13487,7 +13711,7 @@ def list_images_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageListResponse", + "200": "ImageShare", "400": "Error", "401": "Error", "403": "Error", @@ -13497,10 +13721,10 @@ def list_images_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_images_serialize( + def _get_image_share_serialize( self, project_id, - label_selector, + image_id, _request_auth, _content_type, _headers, @@ -13521,11 +13745,9 @@ def _list_images_serialize( # 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 - 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 @@ -13539,7 +13761,7 @@ def _list_images_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/images", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13553,9 +13775,24 @@ def _list_images_serialize( ) @validate_call - def list_key_pairs( + def get_image_share_consumer( 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."), + ], + 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)], @@ -13565,13 +13802,17 @@ 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. + ) -> ImageShareConsumer: + """Get image share consumer. - Get a list of all SSH keypairs assigned to the requesting user. + Get details about an image share consumer. - :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 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 @@ -13594,8 +13835,10 @@ 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._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, @@ -13603,7 +13846,7 @@ def list_key_pairs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "ImageShareConsumer", "400": "Error", "401": "Error", "403": "Error", @@ -13618,9 +13861,24 @@ def list_key_pairs( ).data @validate_call - def list_key_pairs_with_http_info( + def get_image_share_consumer_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."), + ], + 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)], @@ -13630,13 +13888,17 @@ 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[ImageShareConsumer]: + """Get image share consumer. - Get a list of all SSH keypairs assigned to the requesting user. + Get details about an image share consumer. - :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 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 @@ -13659,8 +13921,10 @@ 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._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, @@ -13668,7 +13932,7 @@ def list_key_pairs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "ImageShareConsumer", "400": "Error", "401": "Error", "403": "Error", @@ -13683,9 +13947,24 @@ def list_key_pairs_with_http_info( ) @validate_call - def list_key_pairs_without_preload_content( + def get_image_share_consumer_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."), + ], + 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)], @@ -13696,12 +13975,16 @@ 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. + """Get image share consumer. - Get a list of all SSH keypairs assigned to the requesting user. + Get details about an image share consumer. - :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 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 @@ -13724,8 +14007,10 @@ 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._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, @@ -13733,7 +14018,7 @@ def list_key_pairs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "KeyPairListResponse", + "200": "ImageShareConsumer", "400": "Error", "401": "Error", "403": "Error", @@ -13743,9 +14028,11 @@ 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 _get_image_share_consumer_serialize( self, - label_selector, + project_id, + image_id, + consumer_project_id, _request_auth, _content_type, _headers, @@ -13764,11 +14051,13 @@ 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 + 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 - 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 @@ -13782,7 +14071,7 @@ def _list_key_pairs_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/keypairs", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13796,12 +14085,9 @@ def _list_key_pairs_serialize( ) @validate_call - def list_machine_types( + def get_key_pair( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], + 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)], @@ -13811,13 +14097,13 @@ 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. + ) -> Keypair: + """Get SSH keypair details. - Get a list of all machine type available in a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13840,8 +14126,8 @@ def list_machine_types( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_machine_types_serialize( - project_id=project_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13849,7 +14135,7 @@ def list_machine_types( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineTypeListResponse", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -13864,12 +14150,9 @@ def list_machine_types( ).data @validate_call - def list_machine_types_with_http_info( + def get_key_pair_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], + 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)], @@ -13879,13 +14162,13 @@ 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[Keypair]: + """Get SSH keypair details. - Get a list of all machine type available in a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13908,8 +14191,8 @@ 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( - project_id=project_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13917,7 +14200,7 @@ def list_machine_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineTypeListResponse", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -13932,12 +14215,9 @@ def list_machine_types_with_http_info( ) @validate_call - def list_machine_types_without_preload_content( + def get_key_pair_without_preload_content( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], + 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)], @@ -13948,12 +14228,12 @@ 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. + """Get SSH keypair details. - Get a list of all machine type available in a project. + Get details about an SSH keypair. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -13976,8 +14256,8 @@ 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( - project_id=project_id, + _param = self._get_key_pair_serialize( + keypair_name=keypair_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13985,7 +14265,7 @@ def list_machine_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineTypeListResponse", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -13995,9 +14275,9 @@ 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 _get_key_pair_serialize( self, - project_id, + keypair_name, _request_auth, _content_type, _headers, @@ -14016,8 +14296,8 @@ def _list_machine_types_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id + if keypair_name is not None: + _path_params["keypairName"] = keypair_name # process the query parameters # process the header parameters # process the form parameters @@ -14032,7 +14312,7 @@ def _list_machine_types_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/machine-types", + resource_path="/v1alpha1/keypairs/{keypairName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14046,20 +14326,13 @@ def _list_machine_types_serialize( ) @validate_call - def list_network_area_projects( + def get_machine_type( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14069,15 +14342,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. + ) -> MachineType: + """Get details about a machine type. - Get a list of all projects using a network area. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14100,9 +14373,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._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14110,7 +14383,7 @@ def list_network_area_projects( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -14125,20 +14398,13 @@ def list_network_area_projects( ).data @validate_call - def list_network_area_projects_with_http_info( + def get_machine_type_with_http_info( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14148,15 +14414,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[MachineType]: + """Get details about a machine type. - Get a list of all projects using a network area. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14179,9 +14445,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._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14189,7 +14455,7 @@ def list_network_area_projects_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -14204,20 +14470,13 @@ def list_network_area_projects_with_http_info( ) @validate_call - def list_network_area_projects_without_preload_content( + def get_machine_type_without_preload_content( self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ + project_id: Annotated[ str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], + machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14228,14 +14487,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. + """Get details about a machine type. - Get a list of all projects using a network area. + Get details about a specific machine type. - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param machine_type: STACKIT machine type Name. (required) + :type machine_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14258,9 +14517,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._get_machine_type_serialize( + project_id=project_id, + machine_type=machine_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14268,7 +14527,7 @@ def list_network_area_projects_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectListResponse", + "200": "MachineType", "400": "Error", "401": "Error", "403": "Error", @@ -14278,10 +14537,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 _get_machine_type_serialize( self, - organization_id, - area_id, + project_id, + machine_type, _request_auth, _content_type, _headers, @@ -14300,10 +14559,10 @@ 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 + if machine_type is not None: + _path_params["machineType"] = machine_type # process the query parameters # process the header parameters # process the form parameters @@ -14318,7 +14577,7 @@ def _list_network_area_projects_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/projects", + resource_path="/v1alpha1/projects/{projectId}/machine-types/{machineType}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14332,15 +14591,16 @@ def _list_network_area_projects_serialize( ) @validate_call - def list_network_areas( + def get_network( 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."), + ], + 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, Annotated[StrictFloat, Field(gt=0)], @@ -14350,15 +14610,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. + ) -> Network: + """Get network details. - Get a list of all visible network areas defined in an organization. + Get details about a network of a project. - :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 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 @@ -14381,9 +14641,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, - label_selector=label_selector, + _param = self._get_network_serialize( + project_id=project_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14391,7 +14651,7 @@ def list_network_areas( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -14406,15 +14666,16 @@ def list_network_areas( ).data @validate_call - def list_network_areas_with_http_info( + def get_network_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."), + ], + 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, Annotated[StrictFloat, Field(gt=0)], @@ -14424,15 +14685,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[Network]: + """Get network details. - Get a list of all visible network areas defined in an organization. + Get details about a network of a project. - :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 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 @@ -14455,9 +14716,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, - label_selector=label_selector, + _param = self._get_network_serialize( + project_id=project_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14465,7 +14726,7 @@ def list_network_areas_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -14480,15 +14741,16 @@ def list_network_areas_with_http_info( ) @validate_call - def list_network_areas_without_preload_content( + def get_network_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."), + ], + 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, Annotated[StrictFloat, Field(gt=0)], @@ -14499,14 +14761,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. + """Get network details. - Get a list of all visible network areas defined in an organization. + Get details about a network of a project. - :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 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 @@ -14529,9 +14791,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, - label_selector=label_selector, + _param = self._get_network_serialize( + project_id=project_id, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14539,7 +14801,7 @@ def list_network_areas_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkAreaListResponse", + "200": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -14549,10 +14811,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 _get_network_serialize( self, - organization_id, - label_selector, + project_id, + network_id, _request_auth, _content_type, _headers, @@ -14571,13 +14833,11 @@ 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 + 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 @@ -14591,7 +14851,7 @@ def _list_network_areas_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/organizations/{organizationId}/network-areas", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14605,13 +14865,20 @@ def _list_network_areas_serialize( ) @validate_call - def list_networks( + def get_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." + ), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14621,15 +14888,15 @@ 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. + ) -> NetworkArea: + """Get details about a network area. - Get a list of all networks inside a project. + Get details about 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 _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14652,9 +14919,9 @@ def list_networks( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_networks_serialize( - project_id=project_id, - label_selector=label_selector, + _param = self._get_network_area_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14662,7 +14929,7 @@ def list_networks( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -14677,13 +14944,20 @@ def list_networks( ).data @validate_call - def list_networks_with_http_info( + def get_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." + ), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14693,15 +14967,15 @@ 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[NetworkArea]: + """Get details about a network area. - Get a list of all networks inside a project. + Get details about 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 _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -14724,9 +14998,9 @@ def list_networks_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_networks_serialize( - project_id=project_id, - label_selector=label_selector, + _param = self._get_network_area_serialize( + organization_id=organization_id, + area_id=area_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14734,7 +15008,7 @@ def list_networks_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -14749,9 +15023,11577 @@ def list_networks_with_http_info( ) @validate_call - def list_networks_without_preload_content( + def get_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 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="/v1alpha1/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="/v1alpha1/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="/v1alpha1/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 of a network. + + 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 of a network. + + 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, + ) + + @validate_call + def get_nic_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + 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 interface of a network. + + 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) + return response_data.response + + def _get_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="GET", + resource_path="/v1alpha1/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 get_organization_request( + 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[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _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, + ) -> Request: + """Lookup an organization request ID. + + 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 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 + (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_organization_request_serialize( + organization_id=organization_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "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_organization_request_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[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _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[Request]: + """Lookup an organization request ID. + + 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 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 + (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_organization_request_serialize( + organization_id=organization_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "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_organization_request_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[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _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: + """Lookup an organization request ID. + + 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 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 + (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_organization_request_serialize( + organization_id=organization_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "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_organization_request_serialize( + self, + organization_id, + request_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 request_id is not None: + _path_params["requestId"] = request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/organizations/{organizationId}/requests/{requestId}", + 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_project_details( + self, + 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)], + 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, + ) -> Project: + """Get project details. + + Get details about a STACKIT project. + + :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 + (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_project_details_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Project", + "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_project_details_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + _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[Project]: + """Get project details. + + Get details about a STACKIT project. + + :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 + (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_project_details_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Project", + "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_project_details_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + _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 project details. + + Get details about a STACKIT project. + + :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 + (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_project_details_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Project", + "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_project_details_serialize( + self, + 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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}", + 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_project_nic( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + 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 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 + (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_project_nic_serialize( + project_id=project_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_project_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."), + ], + 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 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 + (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_project_nic_serialize( + project_id=project_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, + ) + + @validate_call + def get_project_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."), + ], + 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: + """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 + (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_project_nic_serialize( + project_id=project_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) + return response_data.response + + def _get_project_nic_serialize( + self, + project_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 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="GET", + resource_path="/v1alpha1/projects/{projectId}/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 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_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, + ) -> Request: + """Lookup a project request ID. + + 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 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 + (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_project_request_serialize( + project_id=project_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "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_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."), + ], + request_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _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[Request]: + """Lookup a project request ID. + + 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 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 + (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_project_request_serialize( + project_id=project_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "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_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."), + ], + request_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Request."), + ], + _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: + """Lookup a project request ID. + + 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 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 + (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_project_request_serialize( + project_id=project_id, + request_id=request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Request", + "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_project_request_serialize( + self, + project_id, + request_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 request_id is not None: + _path_params["requestId"] = request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/requests/{requestId}", + 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_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, + ) -> PublicIp: + """Get details about a public IP. + + Get details about a public IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIp", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_public_ip_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + 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[PublicIp]: + """Get details about a public IP. + + Get details about a public IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIp", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_public_ip_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get details about a public IP. + + Get details about a public IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param public_ip_id: The identifier (ID) of a Public IP. (required) + :type public_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIp", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_public_ip_serialize( + self, + project_id, + public_ip_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if public_ip_id is not None: + _path_params["publicIpId"] = public_ip_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_security_group( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SecurityGroup: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_security_group_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SecurityGroup]: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_security_group_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get security group details. + + Get details about a security group of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroup", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_security_group_serialize( + self, + project_id, + security_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if security_group_id is not None: + _path_params["securityGroupId"] = security_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_security_group_rule( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SecurityGroupRule: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_security_group_rule_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SecurityGroupRule]: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_security_group_rule_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), + ], + security_group_rule_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group Rule.", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get security group rule details. + + Get details about a security group rule of a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) + :type security_group_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_security_group_rule_serialize( + project_id=project_id, + security_group_id=security_group_id, + security_group_rule_id=security_group_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRule", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_security_group_rule_serialize( + self, + project_id, + security_group_id, + security_group_rule_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if security_group_id is not None: + _path_params["securityGroupId"] = security_group_id + if security_group_rule_id is not None: + _path_params["securityGroupRuleId"] = security_group_rule_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_server( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Server: + """Get server details. + + Get details about a server by its ID. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_serialize( + project_id=project_id, + server_id=server_id, + details=details, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Server", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_server_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Server]: + """Get server details. + + Get details about a server by its ID. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_serialize( + project_id=project_id, + server_id=server_id, + details=details, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Server", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_server_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + details: Annotated[Optional[StrictBool], Field(description="Show detailed information about server.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get server details. + + Get details about a server by its ID. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param details: Show detailed information about server. + :type details: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_serialize( + project_id=project_id, + server_id=server_id, + details=details, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Server", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_server_serialize( + self, + project_id, + server_id, + details, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if server_id is not None: + _path_params["serverId"] = server_id + # process the query parameters + if details is not None: + + _query_params.append(("details", details)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_server_console( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServerConsoleUrl: + """Get server console. + + Get a URL for server remote console. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_console_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConsoleUrl", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_server_console_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServerConsoleUrl]: + """Get server console. + + Get a URL for server remote console. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_console_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConsoleUrl", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_server_console_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT 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: + """Get server console. + + Get a URL for server remote console. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_console_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConsoleUrl", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_server_console_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="GET", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/console", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_server_log( + 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."), + ], + 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)], + 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, + ) -> GetServerLog200Response: + """Get server log. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_log_serialize( + project_id=project_id, + server_id=server_id, + length=length, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetServerLog200Response", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_server_log_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."), + ], + 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)], + 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[GetServerLog200Response]: + """Get server log. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_log_serialize( + project_id=project_id, + server_id=server_id, + length=length, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetServerLog200Response", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_server_log_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."), + ], + 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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get server log. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._get_server_log_serialize( + project_id=project_id, + server_id=server_id, + length=length, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetServerLog200Response", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_server_log_serialize( + self, + project_id, + server_id, + length, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if server_id is not None: + _path_params["serverId"] = server_id + # process the query parameters + if length is not None: + + _query_params.append(("length", length)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/log", + 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_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, + ) -> Snapshot: + """Get details about a snapshot. + + Get details about a block device 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 _request_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_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]] = { + "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 get_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[Snapshot]: + """Get details about a snapshot. + + Get details about a block device 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 _request_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_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]] = { + "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 get_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: + """Get details about a snapshot. + + Get details about a block device 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 _request_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_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]] = { + "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 _get_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="GET", + resource_path="/v1alpha1/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 get_virtual_ip( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + _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, + ) -> VirtualIp: + """Get details about a virtual IP. + + Get details about a virtual IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_virtual_ip_serialize( + project_id=project_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VirtualIp", + "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_virtual_ip_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + _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[VirtualIp]: + """Get details about a virtual IP. + + Get details about a virtual IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_virtual_ip_serialize( + project_id=project_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VirtualIp", + "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_virtual_ip_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + _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 virtual IP. + + Get details about a virtual IP inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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_virtual_ip_serialize( + project_id=project_id, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VirtualIp", + "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_virtual_ip_serialize( + self, + project_id, + network_id, + virtual_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 network_id is not None: + _path_params["networkId"] = network_id + if virtual_ip_id is not None: + _path_params["virtualIpId"] = virtual_ip_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}", + 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_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, + ) -> Volume: + """Get details about a volume. + + Get details about a block device volume. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param _request_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_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]] = { + "200": "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, + ).data + + @validate_call + 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."), + ], + 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[Volume]: + """Get details about a volume. + + Get details about a block device volume. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param _request_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_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]] = { + "200": "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 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."), + ], + 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 details about a volume. + + Get details about a block device volume. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param _request_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_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]] = { + "200": "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 _get_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="GET", + resource_path="/v1alpha1/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_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."), + ], + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") + ], + _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, + ) -> VolumePerformanceClass: + """Get details about a volume performance class. + + Get details about a specific volume performance class. + + :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 _request_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_volume_performance_class_serialize( + project_id=project_id, + volume_performance_class=volume_performance_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumePerformanceClass", + "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_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."), + ], + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") + ], + _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[VolumePerformanceClass]: + """Get details about a volume performance class. + + Get details about a specific volume performance class. + + :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 _request_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_volume_performance_class_serialize( + project_id=project_id, + volume_performance_class=volume_performance_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumePerformanceClass", + "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_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."), + ], + volume_performance_class: Annotated[ + str, Field(strict=True, max_length=63, description="The name of a STACKIT Volume performance class.") + ], + _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 volume performance class. + + Get details about a specific volume performance class. + + :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 _request_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_volume_performance_class_serialize( + project_id=project_id, + volume_performance_class=volume_performance_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumePerformanceClass", + "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_volume_performance_class_serialize( + self, + project_id, + volume_performance_class, + _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_performance_class is not None: + _path_params["volumePerformanceClass"] = volume_performance_class + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_affinity_groups( + self, + 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)], + 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, + ) -> AffinityGroupListResponse: + """Get the affinity groups setup for a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_affinity_groups_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "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) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_affinity_groups_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_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[AffinityGroupListResponse]: + """Get the affinity groups setup for a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_affinity_groups_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "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) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_affinity_groups_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_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 groups setup for a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_affinity_groups_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "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 _list_affinity_groups_serialize( + self, + 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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/affinity-groups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_attached_volumes( + 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, + ) -> VolumeAttachmentListResponse: + """List all volume attachments of a server. + + Get a list of all volume attachments of a server. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param 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._list_attached_volumes_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumeAttachmentListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_attached_volumes_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + 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[VolumeAttachmentListResponse]: + """List all volume attachments of a server. + + Get a list of all volume attachments of a server. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param 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._list_attached_volumes_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumeAttachmentListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_attached_volumes_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + 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: + """List all volume attachments of a server. + + Get a list of all volume attachments of a server. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param 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._list_attached_volumes_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumeAttachmentListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_attached_volumes_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="GET", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_availability_zones( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_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": "AvailabilityZoneListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_availability_zones_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_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": "AvailabilityZoneListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_availability_zones_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_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": "AvailabilityZoneListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_availability_zones_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/availability-zones", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_backups( + 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, + _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, + ) -> BackupListResponse: + """List all backups inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_backups_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[BackupListResponse]: + """List all backups inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_backups_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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: + """List all backups inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_backups_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_backups_serialize( + self, + project_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/backups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_images( + 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, + _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, + ) -> ImageListResponse: + """List all Images inside a project. + + Get a list of all images inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_images_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ImageListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_images_with_http_info( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[ImageListResponse]: + """List all Images inside a project. + + Get a list of all images inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_images_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ImageListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_images_without_preload_content( + self, + project_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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: + """List all Images inside a project. + + Get a list of all images inside a project. + + :param project_id: The identifier (ID) of a STACKIT Project. (required) + :type project_id: str + :param 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_images_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ImageListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_images_serialize( + self, + project_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/images", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def 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)], + 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, + ) -> KeyPairListResponse: + """List all SSH keypairs for the requesting user. + + Get a list of all SSH keypairs assigned to the requesting user. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_key_pairs_serialize( + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "KeyPairListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_key_pairs_with_http_info( + self, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[KeyPairListResponse]: + """List all SSH keypairs for the requesting user. + + Get a list of all SSH keypairs assigned to the requesting user. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_key_pairs_serialize( + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "KeyPairListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_key_pairs_without_preload_content( + self, + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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: + """List all SSH keypairs for the requesting user. + + Get a list of all SSH keypairs assigned to the requesting user. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_key_pairs_serialize( + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "KeyPairListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_key_pairs_serialize( + self, + label_selector, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/keypairs", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_machine_types( + self, + 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)], + 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, + ) -> MachineTypeListResponse: + """List all machine types available for 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_machine_types_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MachineTypeListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_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."), + ], + _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[MachineTypeListResponse]: + """List all machine types available for 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_machine_types_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MachineTypeListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_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."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all machine types available for 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_machine_types_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MachineTypeListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_machine_types_serialize( + self, + 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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/machine-types", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_network_area_projects( + 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, + ) -> ProjectListResponse: + """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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_area_projects_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": "ProjectListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_network_area_projects_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[ProjectListResponse]: + """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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_area_projects_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": "ProjectListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_network_area_projects_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: + """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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_area_projects_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": "ProjectListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_network_area_projects_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="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/projects", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_network_area_ranges( + 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, + ) -> NetworkRangeListResponse: + """List all network ranges in a network area. + + Get a list of all network ranges 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_area_ranges_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": "NetworkRangeListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_network_area_ranges_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[NetworkRangeListResponse]: + """List all network ranges in a network area. + + Get a list of all network ranges 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_area_ranges_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": "NetworkRangeListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_network_area_ranges_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: + """List all network ranges in a network area. + + Get a list of all network ranges 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_area_ranges_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": "NetworkRangeListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_network_area_ranges_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="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_network_area_routes( + 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." + ), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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, + ) -> RouteListResponse: + """List all network routes in a network area. + + Get a list of all network routes 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RouteListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_network_area_routes_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." + ), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[RouteListResponse]: + """List all network routes in a network area. + + Get a list of all network routes 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RouteListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_network_area_routes_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." + ), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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: + """List all network routes in a network area. + + Get a list of all network routes 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_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, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RouteListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_network_area_routes_serialize( + self, + organization_id, + area_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_network_areas( + self, + organization_id: Annotated[ + str, + 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)], + 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, + ) -> NetworkAreaListResponse: + """List all network areas in an organization. + + Get a list of all visible network areas defined in an organization. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_areas_serialize( + organization_id=organization_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkAreaListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_network_areas_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." + ), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[NetworkAreaListResponse]: + """List all network areas in an organization. + + Get a list of all visible network areas defined in an organization. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_areas_serialize( + organization_id=organization_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkAreaListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_network_areas_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." + ), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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: + """List all network areas in an organization. + + Get a list of all visible network areas defined in an organization. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_network_areas_serialize( + organization_id=organization_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkAreaListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_network_areas_serialize( + self, + organization_id, + label_selector, + _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 + # 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_networks( + 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, + _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, + ) -> NetworkListResponse: + """List all networks inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_networks_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[NetworkListResponse]: + """List all networks inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_networks_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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: + """List all networks inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_networks_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_networks_serialize( + self, + project_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/networks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_nics( + 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, + 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, + ) -> NICListResponse: + """List all network interfaces inside a network. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_nics_serialize( + project_id=project_id, + network_id=network_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_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."), + ], + 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, + 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[NICListResponse]: + """List all network interfaces inside a network. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_nics_serialize( + project_id=project_id, + network_id=network_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_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."), + ], + 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, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all network interfaces inside a network. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_nics_serialize( + project_id=project_id, + network_id=network_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_nics_serialize( + self, + project_id, + network_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_project_nics( + 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, + _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, + ) -> NICListResponse: + """List all network interfaces inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_project_nics_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[NICListResponse]: + """List all network interfaces inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_project_nics_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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: + """List all network interfaces inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_project_nics_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_project_nics_serialize( + self, + project_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/nics", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_public_ip_ranges( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PublicNetworkListResponse: + """List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ip_ranges_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicNetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_public_ip_ranges_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PublicNetworkListResponse]: + """List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ip_ranges_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicNetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_public_ip_ranges_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ip_ranges_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicNetworkListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_public_ip_ranges_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/networks/public-ip-ranges", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_public_ips( + self, + 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, + _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, + ) -> PublicIpListResponse: + """List all public IPs inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ips_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIpListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_public_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[PublicIpListResponse]: + """List all public IPs inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ips_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIpListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_public_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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: + """List all public IPs inside a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_public_ips_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PublicIpListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_public_ips_serialize( + self, + project_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/public-ips", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_quotas( + self, + 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)], + 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, + ) -> QuotaListResponse: + """List project quotas. + + List quota limits and usage for project resources. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_quotas_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "QuotaListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_quotas_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_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[QuotaListResponse]: + """List project quotas. + + List quota limits and usage for project resources. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_quotas_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "QuotaListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_quotas_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_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List project quotas. + + List quota limits and usage for project resources. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_quotas_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "QuotaListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_quotas_serialize( + self, + 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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/quotas", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_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)], + 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, + ) -> SecurityGroupRuleListResponse: + """List all rules for a security group. + + 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_security_group_rules_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRuleListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_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)], + 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[SecurityGroupRuleListResponse]: + """List all rules for a security group. + + 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_security_group_rules_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRuleListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_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)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all rules for a security group. + + 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_security_group_rules_serialize( + project_id=project_id, + security_group_id=security_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupRuleListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_security_group_rules_serialize( + self, + project_id, + security_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if security_group_id is not None: + _path_params["securityGroupId"] = security_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_security_groups( + 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, + _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, + ) -> SecurityGroupListResponse: + """List all security groups inside a project. + + Get a list of all security groups inside a project. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_security_groups_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_security_groups_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, + _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[SecurityGroupListResponse]: + """List all security groups inside a project. + + Get a list of all security groups inside a project. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_security_groups_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_security_groups_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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all security groups inside a project. + + Get a list of all security groups inside a project. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_security_groups_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SecurityGroupListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_security_groups_serialize( + self, + project_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/security-groups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_server_nics( + 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, + ) -> NICListResponse: + """Get all network interfaces. + + Get all network interfaces attached to 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_server_nics_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_server_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."), + ], + 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[NICListResponse]: + """Get all network interfaces. + + Get all network interfaces attached to 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_server_nics_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_server_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."), + ], + 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: + """Get all network interfaces. + + Get all network interfaces attached to 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_server_nics_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NICListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_server_nics_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="GET", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/nics", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_server_service_accounts( + 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, + ) -> ServiceAccountMailListResponse: + """List all service accounts of the Server. + + Get the list of the service accounts of 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_server_service_accounts_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServiceAccountMailListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_server_service_accounts_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[ServiceAccountMailListResponse]: + """List all service accounts of the Server. + + Get the list of the service accounts of 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_server_service_accounts_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServiceAccountMailListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_server_service_accounts_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: + """List all service accounts of the Server. + + Get the list of the service accounts of 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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_server_service_accounts_serialize( + project_id=project_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServiceAccountMailListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_server_service_accounts_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="GET", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_servers( + 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, + _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, + ) -> ServerListResponse: + """List all servers inside a project. + + Get a list of all servers inside a project. + + :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 + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_servers_serialize( + project_id=project_id, + details=details, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_servers_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, + _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[ServerListResponse]: + """List all servers inside a project. + + Get a list of all servers inside a project. + + :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 + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_servers_serialize( + project_id=project_id, + details=details, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_servers_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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all servers inside a project. + + Get a list of all servers inside a project. + + :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 + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_servers_serialize( + project_id=project_id, + details=details, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_servers_serialize( + self, + project_id, + details, + label_selector, + _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 + if details is not None: + + _query_params.append(("details", details)) + + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/servers", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_snapshots( + 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, + _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, + ) -> SnapshotListResponse: + """List all snapshots 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 + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_snapshots_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SnapshotListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_snapshots_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, + _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[SnapshotListResponse]: + """List all snapshots 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 + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_snapshots_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SnapshotListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_snapshots_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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all snapshots 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 + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_snapshots_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SnapshotListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_snapshots_serialize( + self, + project_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/snapshots", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_virtual_ips( + 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, + 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, + ) -> VirtualIpListResponse: + """List all virtual IPs inside a project. + + Get a list of all virtual IPs 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 + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_virtual_ips_serialize( + project_id=project_id, + network_id=network_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VirtualIpListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_virtual_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."), + ], + 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, + 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[VirtualIpListResponse]: + """List all virtual IPs inside a project. + + Get a list of all virtual IPs 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 + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_virtual_ips_serialize( + project_id=project_id, + network_id=network_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VirtualIpListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_virtual_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."), + ], + 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, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all virtual IPs inside a project. + + Get a list of all virtual IPs 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 + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_virtual_ips_serialize( + project_id=project_id, + network_id=network_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VirtualIpListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_virtual_ips_serialize( + self, + project_id, + network_id, + label_selector, + _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 + 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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, + ) -> VolumePerformanceClassListResponse: + """List all volume performance classes available for a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_volume_performance_classes_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumePerformanceClassListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_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."), + ], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = 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[VolumePerformanceClassListResponse]: + """List all volume performance classes available for a project. + + 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 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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_volume_performance_classes_serialize( + project_id=project_id, + label_selector=label_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "VolumePerformanceClassListResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_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."), ], @@ -14766,9 +26608,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 volume performance classes available for a project. - Get a list of all networks inside a project. + 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 @@ -14796,7 +26638,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_volume_performance_classes_serialize( project_id=project_id, label_selector=label_selector, _request_auth=_request_auth, @@ -14806,7 +26648,7 @@ def list_networks_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkListResponse", + "200": "VolumePerformanceClassListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14816,7 +26658,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_volume_performance_classes_serialize( self, project_id, label_selector, @@ -14858,7 +26700,7 @@ def _list_networks_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks", + resource_path="/v1alpha1/projects/{projectId}/volume-performance-classes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14872,16 +26714,12 @@ def _list_networks_serialize( ) @validate_call - def list_nics( + def list_volumes( 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, @@ -14892,15 +26730,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. + ) -> VolumeListResponse: + """List all volumes inside a project. - Get a list of all network interfaces inside a network. + Get a list of all volumes 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 @@ -14925,9 +26761,8 @@ def list_nics( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_nics_serialize( + _param = self._list_volumes_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -14936,7 +26771,7 @@ def list_nics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "VolumeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -14951,16 +26786,12 @@ def list_nics( ).data @validate_call - def list_nics_with_http_info( + def list_volumes_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - 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, @@ -14971,15 +26802,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[VolumeListResponse]: + """List all volumes inside a project. - Get a list of all network interfaces inside a network. + Get a list of all volumes 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 @@ -15004,9 +26833,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_volumes_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -15015,7 +26843,7 @@ def list_nics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "VolumeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15030,16 +26858,12 @@ def list_nics_with_http_info( ) @validate_call - def list_nics_without_preload_content( + def list_volumes_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - 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, @@ -15051,14 +26875,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 volumes inside a project. - Get a list of all network interfaces inside a network. + Get a list of all volumes 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 @@ -15083,9 +26905,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_volumes_serialize( project_id=project_id, - network_id=network_id, label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, @@ -15094,7 +26915,7 @@ def list_nics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "200": "VolumeListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -15104,10 +26925,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_volumes_serialize( self, project_id, - network_id, label_selector, _request_auth, _content_type, @@ -15129,8 +26949,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: @@ -15149,7 +26967,7 @@ def _list_nics_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics", + resource_path="/v1alpha1/projects/{projectId}/volumes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15163,8 +26981,19 @@ def _list_nics_serialize( ) @validate_call - def list_public_ip_ranges( + 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."), + ], + 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, Annotated[StrictFloat, Field(gt=0)], @@ -15174,11 +27003,17 @@ def list_public_ip_ranges( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PublicNetworkListResponse: - """List all public IP ranges. + ) -> None: + """Update network settings. - Get a list of all public IP ranges that STACKIT uses. + 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 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 @@ -15201,12 +27036,18 @@ def list_public_ip_ranges( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ip_ranges_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + _param = self._partial_update_network_serialize( + project_id=project_id, + network_id=network_id, + partial_update_network_payload=partial_update_network_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicNetworkListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -15221,8 +27062,19 @@ def list_public_ip_ranges( ).data @validate_call - def list_public_ip_ranges_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."), + ], + 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, Annotated[StrictFloat, Field(gt=0)], @@ -15232,11 +27084,17 @@ def list_public_ip_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[PublicNetworkListResponse]: - """List all public IP ranges. + ) -> ApiResponse[None]: + """Update network settings. - Get a list of all public IP ranges that STACKIT uses. + 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 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 @@ -15259,12 +27117,18 @@ def list_public_ip_ranges_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ip_ranges_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + _param = self._partial_update_network_serialize( + project_id=project_id, + network_id=network_id, + partial_update_network_payload=partial_update_network_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicNetworkListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -15279,8 +27143,19 @@ def list_public_ip_ranges_with_http_info( ) @validate_call - def list_public_ip_ranges_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."), + ], + 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, Annotated[StrictFloat, Field(gt=0)], @@ -15291,10 +27166,16 @@ def list_public_ip_ranges_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all public IP ranges. + """Update network settings. - Get a list of all public IP ranges that STACKIT uses. + 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 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 @@ -15317,12 +27198,18 @@ def list_public_ip_ranges_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ip_ranges_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + _param = self._partial_update_network_serialize( + project_id=project_id, + network_id=network_id, + partial_update_network_payload=partial_update_network_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicNetworkListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -15332,8 +27219,11 @@ def list_public_ip_ranges_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_public_ip_ranges_serialize( + def _partial_update_network_serialize( self, + project_id, + network_id, + partial_update_network_payload, _request_auth, _content_type, _headers, @@ -15352,21 +27242,35 @@ def _list_public_ip_ranges_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 # 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="/v1alpha1/networks/public-ip-ranges", + method="PATCH", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15380,13 +27284,23 @@ def _list_public_ip_ranges_serialize( ) @validate_call - def list_public_ips( + 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)], @@ -15396,15 +27310,17 @@ 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. + ) -> NetworkArea: + """Update network area settings. - Get a list of all public IPs 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 @@ -15427,9 +27343,10 @@ def list_public_ips( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_public_ips_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, @@ -15437,7 +27354,7 @@ def list_public_ips( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -15452,13 +27369,23 @@ def list_public_ips( ).data @validate_call - def list_public_ips_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)], @@ -15468,15 +27395,17 @@ 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[NetworkArea]: + """Update network area settings. - Get a list of all public IPs 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 @@ -15499,9 +27428,10 @@ 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( - 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, @@ -15509,7 +27439,7 @@ def list_public_ips_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -15524,13 +27454,23 @@ def list_public_ips_with_http_info( ) @validate_call - def list_public_ips_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)], @@ -15541,14 +27481,16 @@ 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. + """Update network area settings. - Get a list of all public IPs 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 @@ -15571,9 +27513,10 @@ 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( - 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, @@ -15581,7 +27524,7 @@ def list_public_ips_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIpListResponse", + "200": "NetworkArea", "400": "Error", "401": "Error", "403": "Error", @@ -15591,10 +27534,11 @@ 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 _partial_update_network_area_serialize( self, - project_id, - label_selector, + organization_id, + area_id, + partial_update_network_area_payload, _request_auth, _content_type, _headers, @@ -15613,27 +27557,35 @@ def _list_public_ips_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="/v1alpha1/projects/{projectId}/public-ips", + method="PATCH", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15647,21 +27599,17 @@ def _list_public_ips_serialize( ) @validate_call - def list_security_group_rules( + def reboot_server( 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[ + server_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 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)], @@ -15671,15 +27619,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: + """Reboot the server. - Get a list of all rules inside a security group. + 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_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 @@ -15702,9 +27652,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._reboot_server_serialize( project_id=project_id, - security_group_id=security_group_id, + server_id=server_id, + action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15712,11 +27663,12 @@ def list_security_group_rules( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupRuleListResponse", + "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) @@ -15727,21 +27679,17 @@ def list_security_group_rules( ).data @validate_call - def list_security_group_rules_with_http_info( + def reboot_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."), ], - security_group_id: Annotated[ + server_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 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)], @@ -15751,15 +27699,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]: + """Reboot the server. - Get a list of all rules inside a security group. + 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_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 @@ -15782,9 +27732,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._reboot_server_serialize( project_id=project_id, - security_group_id=security_group_id, + server_id=server_id, + action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15792,11 +27743,12 @@ 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", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -15807,21 +27759,17 @@ def list_security_group_rules_with_http_info( ) @validate_call - def list_security_group_rules_without_preload_content( + def reboot_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."), ], - security_group_id: Annotated[ + server_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 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)], @@ -15832,14 +27780,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. + """Reboot the server. - Get a list of all rules inside a security group. + 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_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 @@ -15862,9 +27812,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._reboot_server_serialize( project_id=project_id, - security_group_id=security_group_id, + server_id=server_id, + action=action, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15872,20 +27823,22 @@ 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", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_security_group_rules_serialize( + def _reboot_server_serialize( self, project_id, - security_group_id, + server_id, + action, _request_auth, _content_type, _headers, @@ -15906,9 +27859,13 @@ 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 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 @@ -15921,8 +27878,8 @@ def _list_security_group_rules_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/reboot", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -15936,13 +27893,22 @@ def _list_security_group_rules_serialize( ) @validate_call - def list_security_groups( + def remove_member_from_virtual_ip( 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, + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + remove_member_from_virtual_ip_payload: Annotated[ + RemoveMemberFromVirtualIPPayload, Field(description="Request to remove a member from a virtual IP.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -15952,15 +27918,19 @@ 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. + ) -> VirtualIp: + """Remove a member from the virtual IP. - Get a list of all security groups inside a project. + Atomically remove a member from the virtual IP. :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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param remove_member_from_virtual_ip_payload: Request to remove a member from a virtual IP. (required) + :type remove_member_from_virtual_ip_payload: RemoveMemberFromVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -15983,9 +27953,11 @@ def list_security_groups( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_security_groups_serialize( + _param = self._remove_member_from_virtual_ip_serialize( project_id=project_id, - label_selector=label_selector, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + remove_member_from_virtual_ip_payload=remove_member_from_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -15993,7 +27965,7 @@ def list_security_groups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -16008,13 +27980,22 @@ def list_security_groups( ).data @validate_call - def list_security_groups_with_http_info( + def remove_member_from_virtual_ip_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + remove_member_from_virtual_ip_payload: Annotated[ + RemoveMemberFromVirtualIPPayload, Field(description="Request to remove a member from a virtual IP.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -16024,15 +28005,19 @@ 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[VirtualIp]: + """Remove a member from the virtual IP. - Get a list of all security groups inside a project. + Atomically remove a member from the virtual IP. :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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param remove_member_from_virtual_ip_payload: Request to remove a member from a virtual IP. (required) + :type remove_member_from_virtual_ip_payload: RemoveMemberFromVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -16055,9 +28040,11 @@ 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( + _param = self._remove_member_from_virtual_ip_serialize( project_id=project_id, - label_selector=label_selector, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + remove_member_from_virtual_ip_payload=remove_member_from_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16065,7 +28052,7 @@ def list_security_groups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -16080,13 +28067,22 @@ def list_security_groups_with_http_info( ) @validate_call - def list_security_groups_without_preload_content( + def remove_member_from_virtual_ip_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + remove_member_from_virtual_ip_payload: Annotated[ + RemoveMemberFromVirtualIPPayload, Field(description="Request to remove a member from a virtual IP.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -16097,14 +28093,18 @@ 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. + """Remove a member from the virtual IP. - Get a list of all security groups inside a project. + Atomically remove a member from the virtual IP. :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 network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param remove_member_from_virtual_ip_payload: Request to remove a member from a virtual IP. (required) + :type remove_member_from_virtual_ip_payload: RemoveMemberFromVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -16127,9 +28127,11 @@ 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( + _param = self._remove_member_from_virtual_ip_serialize( project_id=project_id, - label_selector=label_selector, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + remove_member_from_virtual_ip_payload=remove_member_from_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16137,7 +28139,7 @@ def list_security_groups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroupListResponse", + "200": "VirtualIp", "400": "Error", "401": "Error", "403": "Error", @@ -16147,10 +28149,12 @@ 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 _remove_member_from_virtual_ip_serialize( self, project_id, - label_selector, + network_id, + virtual_ip_id, + remove_member_from_virtual_ip_payload, _request_auth, _content_type, _headers, @@ -16171,25 +28175,35 @@ def _list_security_groups_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if network_id is not None: + _path_params["networkId"] = network_id + if virtual_ip_id is not None: + _path_params["virtualIpId"] = virtual_ip_id # 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 remove_member_from_virtual_ip_payload is not None: + _body_params = remove_member_from_virtual_ip_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="/v1alpha1/projects/{projectId}/security-groups", + method="PUT", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -16203,7 +28217,7 @@ def _list_security_groups_serialize( ) @validate_call - def list_server_nics( + def remove_network_from_server( self, project_id: Annotated[ str, @@ -16213,6 +28227,10 @@ def list_server_nics( 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)], @@ -16222,15 +28240,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: + """Detach and delete all network interfaces associated with the specified network. - Get all network interfaces attached to 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 @@ -16253,9 +28273,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._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, @@ -16263,7 +28284,7 @@ def list_server_nics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -16278,7 +28299,7 @@ def list_server_nics( ).data @validate_call - def list_server_nics_with_http_info( + def remove_network_from_server_with_http_info( self, project_id: Annotated[ str, @@ -16288,6 +28309,10 @@ 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."), ], + 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)], @@ -16297,15 +28322,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]: + """Detach and delete all network interfaces associated with the specified network. - Get all network interfaces attached to 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 @@ -16328,9 +28355,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._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, @@ -16338,7 +28366,7 @@ def list_server_nics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -16353,7 +28381,7 @@ def list_server_nics_with_http_info( ) @validate_call - def list_server_nics_without_preload_content( + def remove_network_from_server_without_preload_content( self, project_id: Annotated[ str, @@ -16363,6 +28391,10 @@ 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."), ], + 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)], @@ -16373,14 +28405,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. + """Detach and delete all network interfaces associated with the specified network. - Get all network interfaces attached to 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 @@ -16403,9 +28437,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._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, @@ -16413,7 +28448,7 @@ def list_server_nics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NICListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -16423,10 +28458,11 @@ def list_server_nics_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_server_nics_serialize( + def _remove_network_from_server_serialize( self, project_id, server_id, + network_id, _request_auth, _content_type, _headers, @@ -16449,6 +28485,8 @@ def _list_server_nics_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 @@ -16462,8 +28500,8 @@ def _list_server_nics_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/nics", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -16477,7 +28515,7 @@ def _list_server_nics_serialize( ) @validate_call - def list_server_service_accounts( + def remove_nic_from_server( self, project_id: Annotated[ str, @@ -16487,6 +28525,10 @@ def list_server_service_accounts( 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)], @@ -16496,15 +28538,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 a network interface. - Get the list of the service accounts of the server. + Detach a network interface from a 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 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 @@ -16527,9 +28571,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_nic_from_server_serialize( project_id=project_id, server_id=server_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16537,7 +28582,7 @@ def list_server_service_accounts( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "204": None, "400": "Error", "401": "Error", "403": "Error", @@ -16552,7 +28597,7 @@ def list_server_service_accounts( ).data @validate_call - def list_server_service_accounts_with_http_info( + def remove_nic_from_server_with_http_info( self, project_id: Annotated[ str, @@ -16562,6 +28607,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."), ], + 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)], @@ -16571,15 +28620,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 a network interface. - Get the list of the service accounts of the server. + Detach a network interface from a 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 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 @@ -16602,9 +28653,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_nic_from_server_serialize( project_id=project_id, server_id=server_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16612,7 +28664,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", @@ -16627,7 +28679,7 @@ def list_server_service_accounts_with_http_info( ) @validate_call - def list_server_service_accounts_without_preload_content( + def remove_nic_from_server_without_preload_content( self, project_id: Annotated[ str, @@ -16637,6 +28689,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."), ], + 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)], @@ -16647,14 +28703,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 a network interface. - Get the list of the service accounts of the server. + Detach a network interface from a 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 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 @@ -16677,9 +28735,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_nic_from_server_serialize( project_id=project_id, server_id=server_id, + nic_id=nic_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16687,7 +28746,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", @@ -16697,10 +28756,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_nic_from_server_serialize( self, project_id, server_id, + nic_id, _request_auth, _content_type, _headers, @@ -16723,6 +28783,8 @@ def _list_server_service_accounts_serialize( _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 # process the query parameters # process the header parameters # process the form parameters @@ -16736,8 +28798,8 @@ def _list_server_service_accounts_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -16751,14 +28813,19 @@ def _list_server_service_accounts_serialize( ) @validate_call - def list_servers( + 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."), ], - 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."), + ], + 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)], @@ -16768,17 +28835,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: + """Dissociate a public IP from a server. - Get a list of all servers 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 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 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 @@ -16801,10 +28868,10 @@ def list_servers( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_servers_serialize( + _param = self._remove_public_ip_from_server_serialize( project_id=project_id, - details=details, - label_selector=label_selector, + server_id=server_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16812,11 +28879,12 @@ def list_servers( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "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) @@ -16827,14 +28895,19 @@ def list_servers( ).data @validate_call - def list_servers_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."), ], - 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."), + ], + 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)], @@ -16844,17 +28917,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]: + """Dissociate a public IP from a server. - Get a list of all servers 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 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 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 @@ -16877,10 +28950,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_public_ip_from_server_serialize( project_id=project_id, - details=details, - label_selector=label_selector, + server_id=server_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16888,11 +28961,12 @@ def list_servers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "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) @@ -16903,14 +28977,19 @@ def list_servers_with_http_info( ) @validate_call - def list_servers_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."), ], - 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."), + ], + 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)], @@ -16921,16 +29000,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. + """Dissociate a public IP from a server. - Get a list of all servers 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 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 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 @@ -16953,10 +29032,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_public_ip_from_server_serialize( project_id=project_id, - details=details, - label_selector=label_selector, + server_id=server_id, + public_ip_id=public_ip_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -16964,21 +29043,22 @@ def list_servers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServerListResponse", + "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_servers_serialize( + def _remove_public_ip_from_server_serialize( self, project_id, - details, - label_selector, + server_id, + public_ip_id, _request_auth, _content_type, _headers, @@ -16999,15 +29079,11 @@ def _list_servers_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 details is not None: - - _query_params.append(("details", details)) - - 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 @@ -17020,8 +29096,8 @@ def _list_servers_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -17035,17 +29111,25 @@ def _list_servers_serialize( ) @validate_call - def list_virtual_ips( + 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."), ], - 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."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17055,17 +29139,17 @@ def list_virtual_ips( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VirtualIpListResponse: - """List all virtual IPs inside a project. + ) -> None: + """Remove a server from a security group. - Get a list of all virtual IPs 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 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 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 @@ -17088,10 +29172,10 @@ def list_virtual_ips( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_virtual_ips_serialize( + _param = self._remove_security_group_from_server_serialize( project_id=project_id, - network_id=network_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, @@ -17099,11 +29183,12 @@ def list_virtual_ips( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIpListResponse", + "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) @@ -17114,17 +29199,25 @@ def list_virtual_ips( ).data @validate_call - def list_virtual_ips_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."), ], - 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."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17134,17 +29227,17 @@ def list_virtual_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[VirtualIpListResponse]: - """List all virtual IPs inside a project. + ) -> ApiResponse[None]: + """Remove a server from a security group. - Get a list of all virtual IPs 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 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 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 @@ -17167,10 +29260,10 @@ def list_virtual_ips_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_virtual_ips_serialize( + _param = self._remove_security_group_from_server_serialize( project_id=project_id, - network_id=network_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, @@ -17178,11 +29271,12 @@ def list_virtual_ips_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIpListResponse", + "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) @@ -17193,17 +29287,25 @@ def list_virtual_ips_with_http_info( ) @validate_call - def list_virtual_ips_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."), ], - 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."), + ], + security_group_id: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The identifier (ID) of a STACKIT Security Group.", + ), ], - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -17214,16 +29316,16 @@ def list_virtual_ips_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List all virtual IPs inside a project. + """Remove a server from a security group. - Get a list of all virtual IPs 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 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 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 @@ -17246,10 +29348,10 @@ def list_virtual_ips_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_virtual_ips_serialize( + _param = self._remove_security_group_from_server_serialize( project_id=project_id, - network_id=network_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, @@ -17257,21 +29359,22 @@ def list_virtual_ips_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIpListResponse", + "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_virtual_ips_serialize( + def _remove_security_group_from_server_serialize( self, project_id, - network_id, - label_selector, + server_id, + security_group_id, _request_auth, _content_type, _headers, @@ -17292,13 +29395,11 @@ def _list_virtual_ips_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 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 @@ -17311,8 +29412,8 @@ def _list_virtual_ips_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -17326,13 +29427,19 @@ def _list_virtual_ips_serialize( ) @validate_call - def list_volume_performance_classes( + 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."), ], - 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."), + ], + 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)], @@ -17342,15 +29449,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. + ) -> ServiceAccountMailListResponse: + """Detach a service account from a server. - Get a list of all volume performance classes available 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 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 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 @@ -17373,9 +29482,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_service_account_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17383,11 +29493,12 @@ def list_volume_performance_classes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClassListResponse", + "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) @@ -17398,13 +29509,19 @@ def list_volume_performance_classes( ).data @validate_call - def list_volume_performance_classes_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."), ], - 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."), + ], + 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)], @@ -17414,15 +29531,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[ServiceAccountMailListResponse]: + """Detach a service account from a server. - Get a list of all volume performance classes available 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 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 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 @@ -17445,9 +29564,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_service_account_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17455,11 +29575,12 @@ def list_volume_performance_classes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClassListResponse", + "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) @@ -17470,13 +29591,19 @@ def list_volume_performance_classes_with_http_info( ) @validate_call - def list_volume_performance_classes_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."), ], - 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."), + ], + 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)], @@ -17487,14 +29614,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. + """Detach a service account from a server. - Get a list of all volume performance classes available 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 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 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 @@ -17517,9 +29646,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_service_account_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + service_account_mail=service_account_mail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17527,20 +29657,22 @@ def list_volume_performance_classes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumePerformanceClassListResponse", + "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 _list_volume_performance_classes_serialize( + def _remove_service_account_from_server_serialize( self, project_id, - label_selector, + server_id, + service_account_mail, _request_auth, _content_type, _headers, @@ -17561,11 +29693,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 service_account_mail is not None: + _path_params["serviceAccountMail"] = service_account_mail # 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 @@ -17578,8 +29710,8 @@ def _list_volume_performance_classes_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/volume-performance-classes", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -17593,13 +29725,20 @@ def _list_volume_performance_classes_serialize( ) @validate_call - def list_volumes( + def remove_volume_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."), + ], + 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)], @@ -17609,15 +29748,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: + """Detach a volume from a server. - Get a list of all volumes inside a project. + Detach an existing volume from 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 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 @@ -17640,9 +29781,10 @@ def list_volumes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_volumes_serialize( + _param = self._remove_volume_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17650,11 +29792,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) @@ -17665,13 +29808,20 @@ def list_volumes( ).data @validate_call - def list_volumes_with_http_info( + def remove_volume_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."), + ], + 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)], @@ -17681,15 +29831,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]: + """Detach a volume from a server. - Get a list of all volumes inside a project. + Detach an existing volume from 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 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 @@ -17712,9 +29864,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_volume_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17722,11 +29875,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) @@ -17737,13 +29891,20 @@ def list_volumes_with_http_info( ) @validate_call - def list_volumes_without_preload_content( + def remove_volume_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."), + ], + 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)], @@ -17754,14 +29915,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. + """Detach a volume from a server. - Get a list of all volumes inside a project. + Detach an existing volume from 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 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 @@ -17784,9 +29947,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_volume_from_server_serialize( project_id=project_id, - label_selector=label_selector, + server_id=server_id, + volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -17794,20 +29958,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_volume_from_server_serialize( self, project_id, - label_selector, + server_id, + volume_id, _request_auth, _content_type, _headers, @@ -17828,11 +29994,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 volume_id is not None: + _path_params["volumeId"] = volume_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 @@ -17845,8 +30011,8 @@ def _list_volumes_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/volumes", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -17860,7 +30026,7 @@ def _list_volumes_serialize( ) @validate_call - def reboot_server( + def rescue_server( self, project_id: Annotated[ str, @@ -17870,7 +30036,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)], @@ -17881,16 +30047,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 @@ -17913,10 +30079,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, @@ -17940,7 +30106,7 @@ def reboot_server( ).data @validate_call - def reboot_server_with_http_info( + def rescue_server_with_http_info( self, project_id: Annotated[ str, @@ -17950,7 +30116,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)], @@ -17961,16 +30127,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 @@ -17993,10 +30159,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, @@ -18020,7 +30186,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, @@ -18030,7 +30196,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)], @@ -18041,16 +30207,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 @@ -18073,10 +30239,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, @@ -18095,11 +30261,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, @@ -18123,24 +30289,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="/v1alpha1/projects/{projectId}/servers/{serverId}/reboot", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/rescue", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -18154,22 +30326,17 @@ def _reboot_server_serialize( ) @validate_call - def remove_member_from_virtual_ip( + def resize_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."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") - ], - remove_member_from_virtual_ip_payload: Annotated[ - RemoveMemberFromVirtualIPPayload, Field(description="Request to remove a member from a virtual IP.") + 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.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -18179,19 +30346,17 @@ def remove_member_from_virtual_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VirtualIp: - """Remove a member from the virtual IP. + ) -> None: + """Resize a server. - Atomically remove a member from the virtual IP. + Resize the server to the given machine type. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str - :param remove_member_from_virtual_ip_payload: Request to remove a member from a virtual IP. (required) - :type remove_member_from_virtual_ip_payload: RemoveMemberFromVirtualIPPayload + :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 _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -18214,11 +30379,10 @@ def remove_member_from_virtual_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_member_from_virtual_ip_serialize( + _param = self._resize_server_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - remove_member_from_virtual_ip_payload=remove_member_from_virtual_ip_payload, + server_id=server_id, + resize_server_payload=resize_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18226,11 +30390,12 @@ def remove_member_from_virtual_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "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) @@ -18241,22 +30406,17 @@ def remove_member_from_virtual_ip( ).data @validate_call - def remove_member_from_virtual_ip_with_http_info( + def resize_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."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") - ], - remove_member_from_virtual_ip_payload: Annotated[ - RemoveMemberFromVirtualIPPayload, Field(description="Request to remove a member from a virtual IP.") + 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.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -18266,19 +30426,17 @@ def remove_member_from_virtual_ip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VirtualIp]: - """Remove a member from the virtual IP. + ) -> ApiResponse[None]: + """Resize a server. - Atomically remove a member from the virtual IP. + Resize the server to the given machine type. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str - :param remove_member_from_virtual_ip_payload: Request to remove a member from a virtual IP. (required) - :type remove_member_from_virtual_ip_payload: RemoveMemberFromVirtualIPPayload + :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 _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -18301,11 +30459,10 @@ def remove_member_from_virtual_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_member_from_virtual_ip_serialize( + _param = self._resize_server_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - remove_member_from_virtual_ip_payload=remove_member_from_virtual_ip_payload, + server_id=server_id, + resize_server_payload=resize_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18313,11 +30470,12 @@ def remove_member_from_virtual_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "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) @@ -18328,22 +30486,17 @@ def remove_member_from_virtual_ip_with_http_info( ) @validate_call - def remove_member_from_virtual_ip_without_preload_content( + def resize_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."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") - ], - remove_member_from_virtual_ip_payload: Annotated[ - RemoveMemberFromVirtualIPPayload, Field(description="Request to remove a member from a virtual IP.") + 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.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -18354,18 +30507,16 @@ def remove_member_from_virtual_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Remove a member from the virtual IP. + """Resize a server. - Atomically remove a member from the virtual IP. + Resize the server to the given machine type. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str - :param remove_member_from_virtual_ip_payload: Request to remove a member from a virtual IP. (required) - :type remove_member_from_virtual_ip_payload: RemoveMemberFromVirtualIPPayload + :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 _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -18388,11 +30539,10 @@ def remove_member_from_virtual_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._remove_member_from_virtual_ip_serialize( + _param = self._resize_server_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - remove_member_from_virtual_ip_payload=remove_member_from_virtual_ip_payload, + server_id=server_id, + resize_server_payload=resize_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18400,22 +30550,22 @@ def remove_member_from_virtual_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "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_member_from_virtual_ip_serialize( + def _resize_server_serialize( self, project_id, - network_id, - virtual_ip_id, - remove_member_from_virtual_ip_payload, + server_id, + resize_server_payload, _request_auth, _content_type, _headers, @@ -18436,16 +30586,14 @@ def _remove_member_from_virtual_ip_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - if virtual_ip_id is not None: - _path_params["virtualIpId"] = virtual_ip_id + if 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 - if remove_member_from_virtual_ip_payload is not None: - _body_params = remove_member_from_virtual_ip_payload + if resize_server_payload is not None: + _body_params = resize_server_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -18463,8 +30611,8 @@ def _remove_member_from_virtual_ip_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/resize", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -18478,20 +30626,19 @@ def _remove_member_from_virtual_ip_serialize( ) @validate_call - def remove_network_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."), - ], - network_id: Annotated[ + volume_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 Volume."), ], + resize_volume_payload: Annotated[ + Optional[ResizeVolumePayload], Field(description="Request a volume resize.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -18502,16 +30649,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. + """Update the size of a volume. - Detach and delete all network interfaces associated with the specified network from the 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_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 @@ -18534,10 +30681,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_volume_serialize( project_id=project_id, - server_id=server_id, - network_id=network_id, + volume_id=volume_id, + resize_volume_payload=resize_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18545,11 +30692,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) @@ -18560,20 +30708,19 @@ def remove_network_from_server( ).data @validate_call - def remove_network_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."), - ], - network_id: Annotated[ + volume_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 Volume."), ], + resize_volume_payload: Annotated[ + Optional[ResizeVolumePayload], Field(description="Request a volume resize.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -18584,16 +30731,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. + """Update the size of a volume. - Detach and delete all network interfaces associated with the specified network from the 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_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 @@ -18616,10 +30763,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_volume_serialize( project_id=project_id, - server_id=server_id, - network_id=network_id, + volume_id=volume_id, + resize_volume_payload=resize_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18627,11 +30774,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) @@ -18642,20 +30790,19 @@ def remove_network_from_server_with_http_info( ) @validate_call - def remove_network_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."), - ], - network_id: Annotated[ + volume_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 Volume."), ], + resize_volume_payload: Annotated[ + Optional[ResizeVolumePayload], Field(description="Request a volume resize.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -18666,16 +30813,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. + """Update the size of a volume. - Detach and delete all network interfaces associated with the specified network from the 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 network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_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 @@ -18698,10 +30845,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_volume_serialize( project_id=project_id, - server_id=server_id, - network_id=network_id, + volume_id=volume_id, + resize_volume_payload=resize_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18709,21 +30856,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_volume_serialize( self, project_id, - server_id, - network_id, + volume_id, + resize_volume_payload, _request_auth, _content_type, _headers, @@ -18744,25 +30892,33 @@ def _remove_network_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 network_id is not None: - _path_params["networkId"] = network_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="/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -18776,19 +30932,15 @@ def _remove_network_from_server_serialize( ) @validate_call - def remove_nic_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[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ + backup_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 Backup."), ], _request_timeout: Union[ None, @@ -18800,16 +30952,14 @@ 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. + """Restore Backup to the referenced source Volume. - Detach a network interface from a 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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_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 @@ -18832,10 +30982,9 @@ 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._restore_backup_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18843,7 +30992,7 @@ def remove_nic_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -18858,19 +31007,15 @@ def remove_nic_from_server( ).data @validate_call - def remove_nic_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[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ + backup_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 Backup."), ], _request_timeout: Union[ None, @@ -18882,16 +31027,14 @@ 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. + """Restore Backup to the referenced source Volume. - Detach a network interface from a 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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_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 @@ -18914,10 +31057,9 @@ 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._restore_backup_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -18925,7 +31067,7 @@ 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", @@ -18940,19 +31082,15 @@ def remove_nic_from_server_with_http_info( ) @validate_call - def remove_nic_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[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ + backup_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 Backup."), ], _request_timeout: Union[ None, @@ -18964,16 +31102,14 @@ 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. + """Restore Backup to the referenced source Volume. - Detach a network interface from a 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 nic_id: The identifier (ID) of a network interface. (required) - :type nic_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 @@ -18996,10 +31132,9 @@ 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._restore_backup_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19007,7 +31142,7 @@ 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", @@ -19017,11 +31152,10 @@ def remove_nic_from_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _remove_nic_from_server_serialize( + def _restore_backup_serialize( self, project_id, - server_id, - nic_id, + backup_id, _request_auth, _content_type, _headers, @@ -19042,10 +31176,8 @@ 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 backup_id is not None: + _path_params["backupId"] = backup_id # process the query parameters # process the header parameters # process the form parameters @@ -19059,8 +31191,8 @@ def _remove_nic_from_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/backups/{backupId}/restore", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -19074,19 +31206,16 @@ def _remove_nic_from_server_serialize( ) @validate_call - def remove_public_ip_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."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + 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)], @@ -19096,17 +31225,17 @@ def remove_public_ip_from_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Dissociate a public IP from a server. + ) -> ImageShare: + """Set image share. - Dissociate a public IP on an existing server. + 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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_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 @@ -19129,10 +31258,10 @@ 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._set_image_share_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + image_id=image_id, + set_image_share_payload=set_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19140,12 +31269,11 @@ def remove_public_ip_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) @@ -19156,19 +31284,16 @@ def remove_public_ip_from_server( ).data @validate_call - def remove_public_ip_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."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + 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)], @@ -19178,17 +31303,17 @@ def remove_public_ip_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]: - """Dissociate a public IP from a server. + ) -> ApiResponse[ImageShare]: + """Set image share. - Dissociate a public IP on an existing server. + 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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_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 @@ -19211,10 +31336,10 @@ 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._set_image_share_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + image_id=image_id, + set_image_share_payload=set_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19222,12 +31347,11 @@ def remove_public_ip_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) @@ -19238,19 +31362,16 @@ def remove_public_ip_from_server_with_http_info( ) @validate_call - def remove_public_ip_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."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + 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)], @@ -19261,16 +31382,16 @@ 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. + """Set image share. - Dissociate a public IP on an existing server. + 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 public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_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 @@ -19293,10 +31414,10 @@ 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._set_image_share_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + image_id=image_id, + set_image_share_payload=set_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19304,22 +31425,21 @@ def remove_public_ip_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_public_ip_from_server_serialize( + def _set_image_share_serialize( self, project_id, - server_id, - public_ip_id, + image_id, + set_image_share_payload, _request_auth, _content_type, _headers, @@ -19340,25 +31460,33 @@ 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 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="/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}", + method="PUT", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -19372,7 +31500,7 @@ def _remove_public_ip_from_server_serialize( ) @validate_call - def remove_security_group_from_server( + def start_server( self, project_id: Annotated[ str, @@ -19382,15 +31510,6 @@ def remove_security_group_from_server( 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)], @@ -19401,16 +31520,14 @@ def remove_security_group_from_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Remove a server from a security group. + """Boot up a server. - Remove a server from a attached security group. + 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 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 @@ -19433,10 +31550,9 @@ 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._start_server_serialize( project_id=project_id, server_id=server_id, - security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19444,7 +31560,7 @@ def remove_security_group_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -19460,7 +31576,7 @@ def remove_security_group_from_server( ).data @validate_call - def remove_security_group_from_server_with_http_info( + def start_server_with_http_info( self, project_id: Annotated[ str, @@ -19470,15 +31586,6 @@ def remove_security_group_from_server_with_http_info( 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)], @@ -19489,16 +31596,14 @@ def remove_security_group_from_server_with_http_info( _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. + """Boot up a server. - Remove a server from a attached security group. + 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 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 @@ -19521,10 +31626,9 @@ 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._start_server_serialize( project_id=project_id, server_id=server_id, - security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19532,7 +31636,7 @@ def remove_security_group_from_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -19548,7 +31652,7 @@ def remove_security_group_from_server_with_http_info( ) @validate_call - def remove_security_group_from_server_without_preload_content( + def start_server_without_preload_content( self, project_id: Annotated[ str, @@ -19558,15 +31662,6 @@ def remove_security_group_from_server_without_preload_content( 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)], @@ -19577,16 +31672,14 @@ 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. + """Boot up a server. - Remove a server from a attached security group. + 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 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 @@ -19609,10 +31702,9 @@ 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._start_server_serialize( project_id=project_id, server_id=server_id, - security_group_id=security_group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -19620,7 +31712,7 @@ def remove_security_group_from_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -19631,11 +31723,10 @@ def remove_security_group_from_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _remove_security_group_from_server_serialize( + def _start_server_serialize( self, project_id, server_id, - security_group_id, _request_auth, _content_type, _headers, @@ -19658,8 +31749,6 @@ def _remove_security_group_from_server_serialize( _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 @@ -19673,8 +31762,8 @@ def _remove_security_group_from_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/start", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -19688,7 +31777,7 @@ def _remove_security_group_from_server_serialize( ) @validate_call - def remove_service_account_from_server( + def stop_server( self, project_id: Annotated[ str, @@ -19698,9 +31787,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)], @@ -19710,17 +31796,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: + """Stop an existing server. - Detach an additional service account from the 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 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 @@ -19743,10 +31827,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._stop_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, @@ -19754,7 +31837,7 @@ def remove_service_account_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ServiceAccountMailListResponse", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -19770,7 +31853,7 @@ def remove_service_account_from_server( ).data @validate_call - def remove_service_account_from_server_with_http_info( + def stop_server_with_http_info( self, project_id: Annotated[ str, @@ -19780,9 +31863,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)], @@ -19792,17 +31872,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]: + """Stop an existing server. - Detach an additional service account from the 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 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 @@ -19825,10 +31903,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._stop_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, @@ -19836,7 +31913,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", @@ -19852,7 +31929,7 @@ def remove_service_account_from_server_with_http_info( ) @validate_call - def remove_service_account_from_server_without_preload_content( + def stop_server_without_preload_content( self, project_id: Annotated[ str, @@ -19862,9 +31939,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)], @@ -19875,16 +31949,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. + """Stop an existing server. - Detach an additional service account from the 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 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 @@ -19907,10 +31979,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._stop_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, @@ -19918,7 +31989,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", @@ -19929,11 +32000,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 _stop_server_serialize( self, project_id, server_id, - service_account_mail, _request_auth, _content_type, _headers, @@ -19956,8 +32026,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 @@ -19971,8 +32039,8 @@ def _remove_service_account_from_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/stop", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -19986,7 +32054,7 @@ def _remove_service_account_from_server_serialize( ) @validate_call - def remove_volume_from_server( + def unrescue_server( self, project_id: Annotated[ str, @@ -19996,10 +32064,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)], @@ -20010,16 +32074,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. + """Unrescue an existing server. - Detach an existing volume from an existing server. + 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 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 @@ -20042,10 +32104,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._unrescue_server_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20053,7 +32114,7 @@ def remove_volume_from_server( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -20069,7 +32130,7 @@ def remove_volume_from_server( ).data @validate_call - def remove_volume_from_server_with_http_info( + def unrescue_server_with_http_info( self, project_id: Annotated[ str, @@ -20079,10 +32140,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)], @@ -20093,16 +32150,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. + """Unrescue an existing server. - Detach an existing volume from an existing server. + 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 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 @@ -20125,10 +32180,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._unrescue_server_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20136,7 +32190,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", @@ -20152,7 +32206,7 @@ def remove_volume_from_server_with_http_info( ) @validate_call - def remove_volume_from_server_without_preload_content( + def unrescue_server_without_preload_content( self, project_id: Annotated[ str, @@ -20162,10 +32216,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)], @@ -20176,16 +32226,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. + """Unrescue an existing server. - Detach an existing volume from an existing server. + 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 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 @@ -20208,10 +32256,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._unrescue_server_serialize( project_id=project_id, server_id=server_id, - volume_id=volume_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20219,7 +32266,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", @@ -20230,11 +32277,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 _unrescue_server_serialize( self, project_id, server_id, - volume_id, _request_auth, _content_type, _headers, @@ -20257,8 +32303,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 @@ -20272,8 +32316,8 @@ def _remove_volume_from_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", + method="POST", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -20287,7 +32331,7 @@ def _remove_volume_from_server_serialize( ) @validate_call - def rescue_server( + def update_attached_volume( self, project_id: Annotated[ str, @@ -20297,7 +32341,13 @@ 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.")], + 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)], @@ -20307,17 +32357,19 @@ def rescue_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Rescue an existing server. + ) -> VolumeAttachment: + """Update Volume Attachment Parameters. - 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. + 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 rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload + :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 @@ -20340,10 +32392,11 @@ def rescue_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._rescue_server_serialize( + _param = self._update_attached_volume_serialize( project_id=project_id, server_id=server_id, - rescue_server_payload=rescue_server_payload, + volume_id=volume_id, + update_attached_volume_payload=update_attached_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20351,12 +32404,11 @@ def rescue_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) @@ -20367,7 +32419,7 @@ def rescue_server( ).data @validate_call - def rescue_server_with_http_info( + def update_attached_volume_with_http_info( self, project_id: Annotated[ str, @@ -20377,7 +32429,13 @@ 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.")], + 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)], @@ -20387,17 +32445,19 @@ def rescue_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]: - """Rescue an existing server. + ) -> ApiResponse[VolumeAttachment]: + """Update Volume Attachment Parameters. - 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. + 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 rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload + :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 @@ -20420,10 +32480,11 @@ 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._update_attached_volume_serialize( project_id=project_id, server_id=server_id, - rescue_server_payload=rescue_server_payload, + volume_id=volume_id, + update_attached_volume_payload=update_attached_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20431,12 +32492,11 @@ def rescue_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) @@ -20447,7 +32507,7 @@ def rescue_server_with_http_info( ) @validate_call - def rescue_server_without_preload_content( + def update_attached_volume_without_preload_content( self, project_id: Annotated[ str, @@ -20457,7 +32517,13 @@ 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.")], + 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)], @@ -20468,16 +32534,18 @@ 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. + """Update Volume Attachment Parameters. - 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. + 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 rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload + :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 @@ -20500,10 +32568,11 @@ 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._update_attached_volume_serialize( project_id=project_id, server_id=server_id, - rescue_server_payload=rescue_server_payload, + volume_id=volume_id, + update_attached_volume_payload=update_attached_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20511,22 +32580,22 @@ def rescue_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 _rescue_server_serialize( + def _update_attached_volume_serialize( self, project_id, server_id, - rescue_server_payload, + volume_id, + update_attached_volume_payload, _request_auth, _content_type, _headers, @@ -20549,12 +32618,14 @@ def _rescue_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 rescue_server_payload is not None: - _body_params = rescue_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: @@ -20572,8 +32643,8 @@ def _rescue_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/rescue", + method="PATCH", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -20587,17 +32658,17 @@ def _rescue_server_serialize( ) @validate_call - def resize_server( + 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."), ], - server_id: Annotated[ + backup_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 Backup."), ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], + update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20607,17 +32678,17 @@ 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. + ) -> Backup: + """Update information of a backup. - Resize the server to the given machine type. + Update name or labels of the 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 resize_server_payload: Request a resize of a server. (required) - :type resize_server_payload: ResizeServerPayload + :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 @@ -20640,10 +32711,10 @@ def resize_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._resize_server_serialize( + _param = self._update_backup_serialize( project_id=project_id, - server_id=server_id, - resize_server_payload=resize_server_payload, + backup_id=backup_id, + update_backup_payload=update_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20651,12 +32722,11 @@ def resize_server( ) _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) @@ -20667,17 +32737,17 @@ def resize_server( ).data @validate_call - def resize_server_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."), ], - server_id: Annotated[ + backup_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 Backup."), ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], + update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20687,17 +32757,17 @@ 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[Backup]: + """Update information of a backup. - Resize the server to the given machine type. + Update name or labels of the 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 resize_server_payload: Request a resize of a server. (required) - :type resize_server_payload: ResizeServerPayload + :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 @@ -20720,10 +32790,10 @@ 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_backup_serialize( project_id=project_id, - server_id=server_id, - resize_server_payload=resize_server_payload, + backup_id=backup_id, + update_backup_payload=update_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20731,12 +32801,11 @@ def resize_server_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) @@ -20747,17 +32816,17 @@ def resize_server_with_http_info( ) @validate_call - def resize_server_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."), ], - server_id: Annotated[ + backup_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 Backup."), ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], + update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20768,16 +32837,16 @@ 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 information of a backup. - Resize the server to the given machine type. + Update name or labels of the 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 resize_server_payload: Request a resize of a server. (required) - :type resize_server_payload: ResizeServerPayload + :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 @@ -20800,10 +32869,10 @@ 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_backup_serialize( project_id=project_id, - server_id=server_id, - resize_server_payload=resize_server_payload, + backup_id=backup_id, + update_backup_payload=update_backup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20811,22 +32880,21 @@ def resize_server_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_server_serialize( + def _update_backup_serialize( self, project_id, - server_id, - resize_server_payload, + backup_id, + update_backup_payload, _request_auth, _content_type, _headers, @@ -20847,14 +32915,14 @@ def _resize_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 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_server_payload is not None: - _body_params = resize_server_payload + if update_backup_payload is not None: + _body_params = update_backup_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -20872,8 +32940,8 @@ def _resize_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/resize", + method="PATCH", + resource_path="/v1alpha1/projects/{projectId}/backups/{backupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -20887,19 +32955,16 @@ def _resize_server_serialize( ) @validate_call - def resize_volume( + 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."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], - resize_volume_payload: Annotated[ - Optional[ResizeVolumePayload], Field(description="Request a volume resize.") - ] = None, + update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20909,17 +32974,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. + ) -> Image: + """Update Image Parameters. - Update the size of a block device volume. The new volume size must be larger than the current size. + 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 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 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 @@ -20942,10 +33007,10 @@ def resize_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._resize_volume_serialize( + _param = self._update_image_serialize( project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, + image_id=image_id, + update_image_payload=update_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -20953,12 +33018,11 @@ def resize_volume( ) _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) @@ -20969,19 +33033,16 @@ def resize_volume( ).data @validate_call - def resize_volume_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."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], - resize_volume_payload: Annotated[ - Optional[ResizeVolumePayload], Field(description="Request a volume resize.") - ] = None, + update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -20991,17 +33052,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[Image]: + """Update Image Parameters. - Update the size of a block device volume. The new volume size must be larger than the current size. + 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 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 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 @@ -21024,10 +33085,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_image_serialize( project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, + image_id=image_id, + update_image_payload=update_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21035,12 +33096,11 @@ def resize_volume_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) @@ -21051,19 +33111,16 @@ def resize_volume_with_http_info( ) @validate_call - def resize_volume_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."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + image_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") ], - resize_volume_payload: Annotated[ - Optional[ResizeVolumePayload], Field(description="Request a volume resize.") - ] = None, + update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -21074,16 +33131,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 Image Parameters. - Update the size of a block device volume. The new volume size must be larger than the current size. + 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 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 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 @@ -21106,10 +33163,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_image_serialize( project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, + image_id=image_id, + update_image_payload=update_image_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21117,22 +33174,21 @@ def resize_volume_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 _resize_volume_serialize( + def _update_image_serialize( self, project_id, - volume_id, - resize_volume_payload, + image_id, + update_image_payload, _request_auth, _content_type, _headers, @@ -21153,14 +33209,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 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 resize_volume_payload is not None: - _body_params = resize_volume_payload + if update_image_payload is not None: + _body_params = update_image_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -21178,8 +33234,8 @@ def _resize_volume_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize", + method="PATCH", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -21193,15 +33249,14 @@ def _resize_volume_serialize( ) @validate_call - def start_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, @@ -21212,15 +33267,15 @@ 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 Scope to Local. - Start an existing server or allocates the server if deallocated. + 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 @@ -21243,9 +33298,9 @@ def start_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._start_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, @@ -21253,12 +33308,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) @@ -21269,15 +33323,14 @@ def start_server( ).data @validate_call - def start_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, @@ -21288,15 +33341,15 @@ 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 Scope to Local. - Start an existing server or allocates the server if deallocated. + 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 @@ -21319,9 +33372,9 @@ 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_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, @@ -21329,12 +33382,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) @@ -21345,15 +33397,14 @@ def start_server_with_http_info( ) @validate_call - def start_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, @@ -21365,14 +33416,14 @@ 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 Scope to Local. - Start an existing server or allocates the server if deallocated. + 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 @@ -21395,9 +33446,9 @@ 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_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, @@ -21405,21 +33456,20 @@ 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_scope_local_serialize( self, project_id, - server_id, + image_id, _request_auth, _content_type, _headers, @@ -21440,8 +33490,8 @@ 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 @@ -21455,8 +33505,8 @@ def _start_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/start", + method="DELETE", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/publish", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -21470,15 +33520,14 @@ def _start_server_serialize( ) @validate_call - def stop_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, @@ -21489,15 +33538,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 Public. - 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 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 @@ -21520,9 +33569,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_public_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21530,12 +33579,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) @@ -21546,15 +33594,14 @@ def stop_server( ).data @validate_call - def stop_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, @@ -21565,15 +33612,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 Public. - 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 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 @@ -21596,9 +33643,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_public_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21606,12 +33653,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) @@ -21622,15 +33668,14 @@ def stop_server_with_http_info( ) @validate_call - def stop_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, @@ -21642,14 +33687,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 Public. - 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 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 @@ -21672,9 +33717,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_public_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21682,21 +33727,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_public_serialize( self, project_id, - server_id, + image_id, _request_auth, _content_type, _headers, @@ -21717,8 +33761,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 @@ -21732,8 +33776,8 @@ def _stop_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/stop", + method="PUT", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/publish", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -21747,16 +33791,16 @@ def _stop_server_serialize( ) @validate_call - def unrescue_server( + 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."), + 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)], @@ -21766,15 +33810,17 @@ 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. + ) -> ImageShare: + """Update image share. - Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + 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 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 @@ -21797,9 +33843,10 @@ def unrescue_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._unrescue_server_serialize( + _param = self._update_image_share_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, + update_image_share_payload=update_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21807,12 +33854,11 @@ def unrescue_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": 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) @@ -21823,16 +33869,16 @@ def unrescue_server( ).data @validate_call - def unrescue_server_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."), + 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)], @@ -21842,15 +33888,17 @@ 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[ImageShare]: + """Update image share. - Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + 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 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 @@ -21873,9 +33921,10 @@ 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_share_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, + update_image_share_payload=update_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21883,12 +33932,11 @@ def unrescue_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": 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) @@ -21899,16 +33947,16 @@ def unrescue_server_with_http_info( ) @validate_call - def unrescue_server_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."), + 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)], @@ -21919,14 +33967,16 @@ 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 share. - Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + 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 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 @@ -21949,9 +33999,10 @@ 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_share_serialize( project_id=project_id, - server_id=server_id, + image_id=image_id, + update_image_share_payload=update_image_share_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -21959,21 +34010,21 @@ def unrescue_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": 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 _unrescue_server_serialize( + def _update_image_share_serialize( self, project_id, - server_id, + image_id, + update_image_share_payload, _request_auth, _content_type, _headers, @@ -21994,23 +34045,33 @@ 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 # process the body parameter + 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: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue", + method="PATCH", + resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -22024,22 +34085,11 @@ def _unrescue_server_serialize( ) @validate_call - def update_attached_volume( + def update_key_pair( 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.") + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + update_key_pair_payload: Annotated[ + UpdateKeyPairPayload, Field(description="Request an update of an SSH keypair.") ], _request_timeout: Union[ None, @@ -22050,19 +34100,15 @@ 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. + ) -> Keypair: + """Update information of an SSH keypair. - Update the properties of an existing Volume Attachment. + Update labels of the SSH keypair. - :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 keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str + :param update_key_pair_payload: Request an update of an SSH keypair. (required) + :type update_key_pair_payload: UpdateKeyPairPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22085,11 +34131,9 @@ def update_attached_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_attached_volume_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, + _param = self._update_key_pair_serialize( + keypair_name=keypair_name, + update_key_pair_payload=update_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22097,7 +34141,7 @@ def update_attached_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -22112,22 +34156,11 @@ def update_attached_volume( ).data @validate_call - def update_attached_volume_with_http_info( + def update_key_pair_with_http_info( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - 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.") + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + update_key_pair_payload: Annotated[ + UpdateKeyPairPayload, Field(description="Request an update of an SSH keypair.") ], _request_timeout: Union[ None, @@ -22138,19 +34171,15 @@ 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[Keypair]: + """Update information of an SSH keypair. - Update the properties of an existing Volume Attachment. + Update labels of the SSH keypair. - :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 keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str + :param update_key_pair_payload: Request an update of an SSH keypair. (required) + :type update_key_pair_payload: UpdateKeyPairPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22173,11 +34202,9 @@ 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( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, + _param = self._update_key_pair_serialize( + keypair_name=keypair_name, + update_key_pair_payload=update_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22185,7 +34212,7 @@ def update_attached_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -22200,22 +34227,11 @@ def update_attached_volume_with_http_info( ) @validate_call - def update_attached_volume_without_preload_content( + def update_key_pair_without_preload_content( self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - 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.") + keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], + update_key_pair_payload: Annotated[ + UpdateKeyPairPayload, Field(description="Request an update of an SSH keypair.") ], _request_timeout: Union[ None, @@ -22227,18 +34243,14 @@ 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 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 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 + """Update information of an SSH keypair. + + Update labels of the SSH keypair. + + :param keypair_name: The name of an SSH keypair. (required) + :type keypair_name: str + :param update_key_pair_payload: Request an update of an SSH keypair. (required) + :type update_key_pair_payload: UpdateKeyPairPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22261,11 +34273,9 @@ 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( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, + _param = self._update_key_pair_serialize( + keypair_name=keypair_name, + update_key_pair_payload=update_key_pair_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22273,7 +34283,7 @@ def update_attached_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", + "200": "Keypair", "400": "Error", "401": "Error", "403": "Error", @@ -22283,12 +34293,10 @@ 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_key_pair_serialize( self, - project_id, - server_id, - volume_id, - update_attached_volume_payload, + keypair_name, + update_key_pair_payload, _request_auth, _content_type, _headers, @@ -22307,18 +34315,14 @@ def _update_attached_volume_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 volume_id is not None: - _path_params["volumeId"] = volume_id + 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 - if update_attached_volume_payload is not None: - _body_params = update_attached_volume_payload + if update_key_pair_payload is not None: + _body_params = update_key_pair_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -22337,7 +34341,7 @@ def _update_attached_volume_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", + resource_path="/v1alpha1/keypairs/{keypairName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -22351,16 +34355,21 @@ def _update_attached_volume_serialize( ) @validate_call - def update_image( + def update_nic( 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.") + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -22370,17 +34379,19 @@ def update_image( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Image: - """Update Image Parameters. + ) -> NIC: + """Update a network interface. - Update the properties of an existing Image inside a project. + Update the properties of an existing network interface inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param update_image_payload: Request an update of an Image. (required) - :type update_image_payload: UpdateImagePayload + :param 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 update_nic_payload: Request an update of a network interface. (required) + :type update_nic_payload: UpdateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22403,10 +34414,11 @@ def update_image( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_image_serialize( + _param = self._update_nic_serialize( project_id=project_id, - image_id=image_id, - update_image_payload=update_image_payload, + network_id=network_id, + nic_id=nic_id, + update_nic_payload=update_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22414,11 +34426,12 @@ def update_image( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", + "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) @@ -22429,16 +34442,21 @@ def update_image( ).data @validate_call - def update_image_with_http_info( + def update_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."), ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -22448,17 +34466,19 @@ def update_image_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[Image]: - """Update Image Parameters. + ) -> ApiResponse[NIC]: + """Update a network interface. - Update the properties of an existing Image inside a project. + Update the properties of an existing network interface inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param update_image_payload: Request an update of an Image. (required) - :type update_image_payload: UpdateImagePayload + :param 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 update_nic_payload: Request an update of a network interface. (required) + :type update_nic_payload: UpdateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22481,10 +34501,11 @@ def update_image_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_image_serialize( + _param = self._update_nic_serialize( project_id=project_id, - image_id=image_id, - update_image_payload=update_image_payload, + network_id=network_id, + nic_id=nic_id, + update_nic_payload=update_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22492,11 +34513,12 @@ def update_image_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", + "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) @@ -22507,16 +34529,21 @@ def update_image_with_http_info( ) @validate_call - def update_image_without_preload_content( + def update_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."), ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") + network_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], + nic_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + ], + update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -22527,16 +34554,18 @@ def update_image_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Image Parameters. + """Update a network interface. - Update the properties of an existing Image inside a project. + Update the properties of an existing network interface inside a network. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param update_image_payload: Request an update of an Image. (required) - :type update_image_payload: UpdateImagePayload + :param 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 update_nic_payload: Request an update of a network interface. (required) + :type update_nic_payload: UpdateNicPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22559,10 +34588,11 @@ def update_image_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_image_serialize( + _param = self._update_nic_serialize( project_id=project_id, - image_id=image_id, - update_image_payload=update_image_payload, + network_id=network_id, + nic_id=nic_id, + update_nic_payload=update_nic_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22570,21 +34600,23 @@ def update_image_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", + "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 _update_image_serialize( + def _update_nic_serialize( self, project_id, - image_id, - update_image_payload, + network_id, + nic_id, + update_nic_payload, _request_auth, _content_type, _headers, @@ -22605,14 +34637,16 @@ def _update_image_serialize( # 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 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 - if update_image_payload is not None: - _body_params = update_image_payload + if update_nic_payload is not None: + _body_params = update_nic_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -22631,7 +34665,7 @@ def _update_image_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -22645,11 +34679,17 @@ def _update_image_serialize( ) @validate_call - def update_key_pair( + def update_public_ip( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - update_key_pair_payload: Annotated[ - UpdateKeyPairPayload, Field(description="Request an update 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."), + ], + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + ], + update_public_ip_payload: Annotated[ + UpdatePublicIPPayload, Field(description="Request an update of a public IP.") ], _request_timeout: Union[ None, @@ -22660,15 +34700,17 @@ def update_key_pair( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Keypair: - """Update information of an SSH keypair. + ) -> PublicIp: + """Update a public IP. - Update labels of the SSH keypair. + Update the properties of an existing public IP inside a project. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param update_key_pair_payload: Request an update of an SSH keypair. (required) - :type update_key_pair_payload: UpdateKeyPairPayload + :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 update_public_ip_payload: Request an update of a public IP. (required) + :type update_public_ip_payload: UpdatePublicIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22691,9 +34733,10 @@ def update_key_pair( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_key_pair_serialize( - keypair_name=keypair_name, - update_key_pair_payload=update_key_pair_payload, + _param = self._update_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + update_public_ip_payload=update_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22701,7 +34744,7 @@ def update_key_pair( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "PublicIp", "400": "Error", "401": "Error", "403": "Error", @@ -22716,11 +34759,17 @@ def update_key_pair( ).data @validate_call - def update_key_pair_with_http_info( + def update_public_ip_with_http_info( self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - update_key_pair_payload: Annotated[ - UpdateKeyPairPayload, Field(description="Request an update 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."), + ], + public_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + ], + update_public_ip_payload: Annotated[ + UpdatePublicIPPayload, Field(description="Request an update of a public IP.") ], _request_timeout: Union[ None, @@ -22731,15 +34780,17 @@ def update_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]: - """Update information of an SSH keypair. + ) -> ApiResponse[PublicIp]: + """Update a public IP. - Update labels of the SSH keypair. + Update the properties of an existing public IP inside a project. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param update_key_pair_payload: Request an update of an SSH keypair. (required) - :type update_key_pair_payload: UpdateKeyPairPayload + :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 update_public_ip_payload: Request an update of a public IP. (required) + :type update_public_ip_payload: UpdatePublicIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22762,9 +34813,10 @@ def update_key_pair_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_key_pair_serialize( - keypair_name=keypair_name, - update_key_pair_payload=update_key_pair_payload, + _param = self._update_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + update_public_ip_payload=update_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22772,7 +34824,7 @@ def update_key_pair_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "PublicIp", "400": "Error", "401": "Error", "403": "Error", @@ -22787,11 +34839,17 @@ def update_key_pair_with_http_info( ) @validate_call - def update_key_pair_without_preload_content( - self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - update_key_pair_payload: Annotated[ - UpdateKeyPairPayload, Field(description="Request an update of an SSH keypair.") + def update_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.") + ], + update_public_ip_payload: Annotated[ + UpdatePublicIPPayload, Field(description="Request an update of a public IP.") ], _request_timeout: Union[ None, @@ -22803,14 +34861,16 @@ def update_key_pair_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update information of an SSH keypair. + """Update a public IP. - Update labels of the SSH keypair. + Update the properties of an existing public IP inside a project. - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param update_key_pair_payload: Request an update of an SSH keypair. (required) - :type update_key_pair_payload: UpdateKeyPairPayload + :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 update_public_ip_payload: Request an update of a public IP. (required) + :type update_public_ip_payload: UpdatePublicIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22833,9 +34893,10 @@ def update_key_pair_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_key_pair_serialize( - keypair_name=keypair_name, - update_key_pair_payload=update_key_pair_payload, + _param = self._update_public_ip_serialize( + project_id=project_id, + public_ip_id=public_ip_id, + update_public_ip_payload=update_public_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22843,7 +34904,7 @@ def update_key_pair_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", + "200": "PublicIp", "400": "Error", "401": "Error", "403": "Error", @@ -22853,10 +34914,11 @@ def update_key_pair_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_key_pair_serialize( + def _update_public_ip_serialize( self, - keypair_name, - update_key_pair_payload, + project_id, + public_ip_id, + update_public_ip_payload, _request_auth, _content_type, _headers, @@ -22875,14 +34937,16 @@ def _update_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 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 - if update_key_pair_payload is not None: - _body_params = update_key_pair_payload + if update_public_ip_payload is not None: + _body_params = update_public_ip_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -22901,7 +34965,7 @@ def _update_key_pair_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/keypairs/{keypairName}", + resource_path="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -22915,21 +34979,24 @@ def _update_key_pair_serialize( ) @validate_call - def update_nic( + def update_security_group( 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[ + security_group_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 Security Group.", + ), ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + update_security_group_payload: Annotated[ + UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") ], - update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -22939,19 +35006,17 @@ def update_nic( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NIC: - """Update a network interface. + ) -> SecurityGroup: + """Update information of a security group. - Update the properties of an existing network interface inside a network. + Update labels of the security group. :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 update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNicPayload + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param update_security_group_payload: Request an update of a security group. (required) + :type update_security_group_payload: UpdateSecurityGroupPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -22974,11 +35039,10 @@ def update_nic( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_nic_serialize( + _param = self._update_security_group_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, - update_nic_payload=update_nic_payload, + security_group_id=security_group_id, + update_security_group_payload=update_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -22986,12 +35050,11 @@ def update_nic( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "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) @@ -23002,21 +35065,24 @@ def update_nic( ).data @validate_call - def update_nic_with_http_info( + def update_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."), ], - network_id: Annotated[ + security_group_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 Security Group.", + ), ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + update_security_group_payload: Annotated[ + UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") ], - update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -23026,19 +35092,17 @@ def update_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]: - """Update a network interface. + ) -> ApiResponse[SecurityGroup]: + """Update information of a security group. - Update the properties of an existing network interface inside a network. + Update labels of the security group. :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 update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNicPayload + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param update_security_group_payload: Request an update of a security group. (required) + :type update_security_group_payload: UpdateSecurityGroupPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -23061,11 +35125,10 @@ def update_nic_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_nic_serialize( + _param = self._update_security_group_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, - update_nic_payload=update_nic_payload, + security_group_id=security_group_id, + update_security_group_payload=update_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23073,12 +35136,11 @@ def update_nic_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "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) @@ -23089,21 +35151,24 @@ def update_nic_with_http_info( ) @validate_call - def update_nic_without_preload_content( + def update_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."), ], - network_id: Annotated[ + security_group_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 Security Group.", + ), ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), + update_security_group_payload: Annotated[ + UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") ], - update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update of a network interface.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -23114,18 +35179,16 @@ def update_nic_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a network interface. + """Update information of a security group. - Update the properties of an existing network interface inside a network. + Update labels of the security group. :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 update_nic_payload: Request an update of a network interface. (required) - :type update_nic_payload: UpdateNicPayload + :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) + :type security_group_id: str + :param update_security_group_payload: Request an update of a security group. (required) + :type update_security_group_payload: UpdateSecurityGroupPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -23148,11 +35211,10 @@ def update_nic_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_nic_serialize( + _param = self._update_security_group_serialize( project_id=project_id, - network_id=network_id, - nic_id=nic_id, - update_nic_payload=update_nic_payload, + security_group_id=security_group_id, + update_security_group_payload=update_security_group_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23160,23 +35222,21 @@ def update_nic_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "NIC", + "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 _update_nic_serialize( + def _update_security_group_serialize( self, project_id, - network_id, - nic_id, - update_nic_payload, + security_group_id, + update_security_group_payload, _request_auth, _content_type, _headers, @@ -23197,16 +35257,14 @@ def _update_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 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 update_nic_payload is not None: - _body_params = update_nic_payload + if update_security_group_payload is not None: + _body_params = update_security_group_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -23225,7 +35283,7 @@ def _update_nic_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}", + resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -23239,18 +35297,17 @@ def _update_nic_serialize( ) @validate_call - def update_public_ip( + def update_server( 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.") - ], - update_public_ip_payload: Annotated[ - UpdatePublicIPPayload, Field(description="Request an update of a public IP.") + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -23260,17 +35317,17 @@ def update_public_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PublicIp: - """Update a public IP. + ) -> Server: + """Update information of a server. - Update the properties of an existing public IP inside a project. + Update name or labels of the server. :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 update_public_ip_payload: Request an update of a public IP. (required) - :type update_public_ip_payload: UpdatePublicIPPayload + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param update_server_payload: Request an update of a server. (required) + :type update_server_payload: UpdateServerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -23293,10 +35350,10 @@ def update_public_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_public_ip_serialize( + _param = self._update_server_serialize( project_id=project_id, - public_ip_id=public_ip_id, - update_public_ip_payload=update_public_ip_payload, + server_id=server_id, + update_server_payload=update_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23304,7 +35361,7 @@ def update_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -23319,18 +35376,17 @@ def update_public_ip( ).data @validate_call - def update_public_ip_with_http_info( + def update_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."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], - update_public_ip_payload: Annotated[ - UpdatePublicIPPayload, Field(description="Request an update of a public IP.") + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -23340,17 +35396,17 @@ def update_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]: - """Update a public IP. + ) -> ApiResponse[Server]: + """Update information of a server. - Update the properties of an existing public IP inside a project. + Update name or labels of the server. :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 update_public_ip_payload: Request an update of a public IP. (required) - :type update_public_ip_payload: UpdatePublicIPPayload + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param update_server_payload: Request an update of a server. (required) + :type update_server_payload: UpdateServerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -23373,10 +35429,10 @@ def update_public_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_public_ip_serialize( + _param = self._update_server_serialize( project_id=project_id, - public_ip_id=public_ip_id, - update_public_ip_payload=update_public_ip_payload, + server_id=server_id, + update_server_payload=update_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23384,7 +35440,7 @@ def update_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -23399,18 +35455,17 @@ def update_public_ip_with_http_info( ) @validate_call - def update_public_ip_without_preload_content( + def update_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."), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], - update_public_ip_payload: Annotated[ - UpdatePublicIPPayload, Field(description="Request an update of a public IP.") + server_id: Annotated[ + str, + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), ], + update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -23421,16 +35476,16 @@ def update_public_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a public IP. + """Update information of a server. - Update the properties of an existing public IP inside a project. + Update name or labels of the server. :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 update_public_ip_payload: Request an update of a public IP. (required) - :type update_public_ip_payload: UpdatePublicIPPayload + :param server_id: The identifier (ID) of a STACKIT Server. (required) + :type server_id: str + :param update_server_payload: Request an update of a server. (required) + :type update_server_payload: UpdateServerPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -23453,10 +35508,10 @@ def update_public_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_public_ip_serialize( + _param = self._update_server_serialize( project_id=project_id, - public_ip_id=public_ip_id, - update_public_ip_payload=update_public_ip_payload, + server_id=server_id, + update_server_payload=update_server_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23464,7 +35519,7 @@ def update_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "Server", "400": "Error", "401": "Error", "403": "Error", @@ -23474,11 +35529,11 @@ def update_public_ip_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_public_ip_serialize( + def _update_server_serialize( self, project_id, - public_ip_id, - update_public_ip_payload, + server_id, + update_server_payload, _request_auth, _content_type, _headers, @@ -23499,14 +35554,14 @@ def _update_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 + 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 - if update_public_ip_payload is not None: - _body_params = update_public_ip_payload + if update_server_payload is not None: + _body_params = update_server_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -23525,7 +35580,7 @@ def _update_public_ip_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", + resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -23539,23 +35594,18 @@ def _update_public_ip_serialize( ) @validate_call - def update_security_group( + 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."), ], - security_group_id: Annotated[ + snapshot_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 Snapshot."), ], - update_security_group_payload: Annotated[ - UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") + update_snapshot_payload: Annotated[ + UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") ], _request_timeout: Union[ None, @@ -23566,17 +35616,17 @@ def update_security_group( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecurityGroup: - """Update information of a security group. + ) -> Snapshot: + """Update information of the snapshot. - Update labels of the security group. + 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param update_security_group_payload: Request an update of a security group. (required) - :type update_security_group_payload: UpdateSecurityGroupPayload + :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 @@ -23599,10 +35649,10 @@ def update_security_group( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_security_group_serialize( + _param = self._update_snapshot_serialize( project_id=project_id, - security_group_id=security_group_id, - update_security_group_payload=update_security_group_payload, + snapshot_id=snapshot_id, + update_snapshot_payload=update_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23610,7 +35660,7 @@ def update_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -23625,23 +35675,18 @@ def update_security_group( ).data @validate_call - def update_security_group_with_http_info( + 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."), ], - security_group_id: Annotated[ + snapshot_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 Snapshot."), ], - update_security_group_payload: Annotated[ - UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") + update_snapshot_payload: Annotated[ + UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") ], _request_timeout: Union[ None, @@ -23652,17 +35697,17 @@ def update_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]: - """Update information of a security group. + ) -> ApiResponse[Snapshot]: + """Update information of the snapshot. - Update labels of the security group. + 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param update_security_group_payload: Request an update of a security group. (required) - :type update_security_group_payload: UpdateSecurityGroupPayload + :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 @@ -23685,10 +35730,10 @@ def update_security_group_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_security_group_serialize( + _param = self._update_snapshot_serialize( project_id=project_id, - security_group_id=security_group_id, - update_security_group_payload=update_security_group_payload, + snapshot_id=snapshot_id, + update_snapshot_payload=update_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23696,7 +35741,7 @@ def update_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -23711,23 +35756,18 @@ def update_security_group_with_http_info( ) @validate_call - def update_security_group_without_preload_content( + 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."), ], - security_group_id: Annotated[ + snapshot_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 Snapshot."), ], - update_security_group_payload: Annotated[ - UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") + update_snapshot_payload: Annotated[ + UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") ], _request_timeout: Union[ None, @@ -23739,16 +35779,16 @@ def update_security_group_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update information of a security group. + """Update information of the snapshot. - Update labels of the security group. + 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 security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param update_security_group_payload: Request an update of a security group. (required) - :type update_security_group_payload: UpdateSecurityGroupPayload + :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 @@ -23771,10 +35811,10 @@ def update_security_group_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_security_group_serialize( + _param = self._update_snapshot_serialize( project_id=project_id, - security_group_id=security_group_id, - update_security_group_payload=update_security_group_payload, + snapshot_id=snapshot_id, + update_snapshot_payload=update_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23782,7 +35822,7 @@ def update_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "Snapshot", "400": "Error", "401": "Error", "403": "Error", @@ -23792,11 +35832,11 @@ def update_security_group_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_security_group_serialize( + def _update_snapshot_serialize( self, project_id, - security_group_id, - update_security_group_payload, + snapshot_id, + update_snapshot_payload, _request_auth, _content_type, _headers, @@ -23817,14 +35857,14 @@ def _update_security_group_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id + if 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_security_group_payload is not None: - _body_params = update_security_group_payload + if update_snapshot_payload is not None: + _body_params = update_snapshot_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -23843,7 +35883,7 @@ def _update_security_group_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", + resource_path="/v1alpha1/projects/{projectId}/snapshots/{snapshotId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -23857,17 +35897,22 @@ def _update_security_group_serialize( ) @validate_call - def update_server( + def update_virtual_ip( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + update_virtual_ip_payload: Annotated[ + UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") ], - update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -23877,17 +35922,19 @@ def update_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Server: - """Update information of a server. + ) -> None: + """Update a virtual IP. - Update name or labels of the server. + Update the properties of an existing virtual IP inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param update_server_payload: Request an update of a server. (required) - :type update_server_payload: UpdateServerPayload + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param update_virtual_ip_payload: Request an update of a virtual IP. (required) + :type update_virtual_ip_payload: UpdateVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -23910,10 +35957,11 @@ def update_server( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_server_serialize( + _param = self._update_virtual_ip_serialize( project_id=project_id, - server_id=server_id, - update_server_payload=update_server_payload, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + update_virtual_ip_payload=update_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -23921,7 +35969,7 @@ def update_server( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -23936,17 +35984,22 @@ def update_server( ).data @validate_call - def update_server_with_http_info( + def update_virtual_ip_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + update_virtual_ip_payload: Annotated[ + UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") ], - update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -23956,17 +36009,19 @@ def update_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]: - """Update information of a server. + ) -> ApiResponse[None]: + """Update a virtual IP. - Update name or labels of the server. + Update the properties of an existing virtual IP inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param update_server_payload: Request an update of a server. (required) - :type update_server_payload: UpdateServerPayload + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param update_virtual_ip_payload: Request an update of a virtual IP. (required) + :type update_virtual_ip_payload: UpdateVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -23989,10 +36044,11 @@ def update_server_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_server_serialize( + _param = self._update_virtual_ip_serialize( project_id=project_id, - server_id=server_id, - update_server_payload=update_server_payload, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + update_virtual_ip_payload=update_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -24000,7 +36056,7 @@ def update_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -24015,17 +36071,22 @@ def update_server_with_http_info( ) @validate_call - def update_server_without_preload_content( + def update_virtual_ip_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + ], + virtual_ip_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + ], + update_virtual_ip_payload: Annotated[ + UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") ], - update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -24036,16 +36097,18 @@ def update_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update information of a server. + """Update a virtual IP. - Update name or labels of the server. + Update the properties of an existing virtual IP inside a project. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param update_server_payload: Request an update of a server. (required) - :type update_server_payload: UpdateServerPayload + :param network_id: The identifier (ID) of a STACKIT Network. (required) + :type network_id: str + :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) + :type virtual_ip_id: str + :param update_virtual_ip_payload: Request an update of a virtual IP. (required) + :type update_virtual_ip_payload: UpdateVirtualIPPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -24068,10 +36131,11 @@ def update_server_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_server_serialize( + _param = self._update_virtual_ip_serialize( project_id=project_id, - server_id=server_id, - update_server_payload=update_server_payload, + network_id=network_id, + virtual_ip_id=virtual_ip_id, + update_virtual_ip_payload=update_virtual_ip_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -24079,7 +36143,7 @@ def update_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "202": None, "400": "Error", "401": "Error", "403": "Error", @@ -24089,11 +36153,12 @@ def update_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_server_serialize( + def _update_virtual_ip_serialize( self, project_id, - server_id, - update_server_payload, + network_id, + virtual_ip_id, + update_virtual_ip_payload, _request_auth, _content_type, _headers, @@ -24114,14 +36179,16 @@ def _update_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 network_id is not None: + _path_params["networkId"] = network_id + if virtual_ip_id is not None: + _path_params["virtualIpId"] = virtual_ip_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_server_payload is not None: - _body_params = update_server_payload + if update_virtual_ip_payload is not None: + _body_params = update_virtual_ip_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -24140,7 +36207,7 @@ def _update_server_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}", + resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -24154,22 +36221,17 @@ def _update_server_serialize( ) @validate_call - def update_virtual_ip( + def update_volume( 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[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") - ], - update_virtual_ip_payload: Annotated[ - UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], + update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -24179,19 +36241,17 @@ def update_virtual_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update a virtual IP. + ) -> Volume: + """Update information of a volume. - Update the properties of an existing virtual IP inside a project. + Update name, description or labels of the volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str - :param update_virtual_ip_payload: Request an update of a virtual IP. (required) - :type update_virtual_ip_payload: UpdateVirtualIPPayload + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param update_volume_payload: Request an update of a volume. (required) + :type update_volume_payload: UpdateVolumePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -24214,11 +36274,10 @@ def update_virtual_ip( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_virtual_ip_serialize( + _param = self._update_volume_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - update_virtual_ip_payload=update_virtual_ip_payload, + volume_id=volume_id, + update_volume_payload=update_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -24226,7 +36285,7 @@ def update_virtual_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -24241,22 +36300,17 @@ def update_virtual_ip( ).data @validate_call - def update_virtual_ip_with_http_info( + def update_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."), ], - network_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") - ], - update_virtual_ip_payload: Annotated[ - UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], + update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -24266,19 +36320,17 @@ def update_virtual_ip_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update a virtual IP. + ) -> ApiResponse[Volume]: + """Update information of a volume. - Update the properties of an existing virtual IP inside a project. + Update name, description or labels of the volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str - :param update_virtual_ip_payload: Request an update of a virtual IP. (required) - :type update_virtual_ip_payload: UpdateVirtualIPPayload + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param update_volume_payload: Request an update of a volume. (required) + :type update_volume_payload: UpdateVolumePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -24301,11 +36353,10 @@ def update_virtual_ip_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_virtual_ip_serialize( + _param = self._update_volume_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - update_virtual_ip_payload=update_virtual_ip_payload, + volume_id=volume_id, + update_volume_payload=update_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -24313,7 +36364,7 @@ def update_virtual_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -24328,22 +36379,17 @@ def update_virtual_ip_with_http_info( ) @validate_call - def update_virtual_ip_without_preload_content( + def update_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."), ], - network_id: Annotated[ + volume_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") - ], - update_virtual_ip_payload: Annotated[ - UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), ], + update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -24354,18 +36400,16 @@ def update_virtual_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a virtual IP. + """Update information of a volume. - Update the properties of an existing virtual IP inside a project. + Update name, description or labels of the volume. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param virtual_ip_id: The identifier (ID) of a Virtual IP. (required) - :type virtual_ip_id: str - :param update_virtual_ip_payload: Request an update of a virtual IP. (required) - :type update_virtual_ip_payload: UpdateVirtualIPPayload + :param volume_id: The identifier (ID) of a STACKIT Volume. (required) + :type volume_id: str + :param update_volume_payload: Request an update of a volume. (required) + :type update_volume_payload: UpdateVolumePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -24388,11 +36432,10 @@ def update_virtual_ip_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_virtual_ip_serialize( + _param = self._update_volume_serialize( project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - update_virtual_ip_payload=update_virtual_ip_payload, + volume_id=volume_id, + update_volume_payload=update_volume_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -24400,7 +36443,7 @@ def update_virtual_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "Volume", "400": "Error", "401": "Error", "403": "Error", @@ -24410,12 +36453,11 @@ def update_virtual_ip_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_virtual_ip_serialize( + def _update_volume_serialize( self, project_id, - network_id, - virtual_ip_id, - update_virtual_ip_payload, + volume_id, + update_volume_payload, _request_auth, _content_type, _headers, @@ -24436,16 +36478,14 @@ def _update_virtual_ip_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - if virtual_ip_id is not None: - _path_params["virtualIpId"] = virtual_ip_id + if volume_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 update_virtual_ip_payload is not None: - _body_params = update_virtual_ip_payload + if update_volume_payload is not None: + _body_params = update_volume_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -24464,7 +36504,7 @@ def _update_virtual_ip_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}", + resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -24478,17 +36518,26 @@ def _update_virtual_ip_serialize( ) @validate_call - def update_volume( + def v1alpha1_update_route_of_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." + ), ], - volume_id: Annotated[ + area_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 Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + v1alpha1_update_route_of_area_payload: Annotated[ + V1alpha1UpdateRouteOfAreaPayload, Field(description="Request an update of a network route.") ], - update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -24498,17 +36547,19 @@ def update_volume( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Volume: - """Update information of a volume. + ) -> Route: + """Update a network route. - Update name, description or labels of the volume. + Update a network route defined in a network area. - :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 update_volume_payload: Request an update of a volume. (required) - :type update_volume_payload: UpdateVolumePayload + :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 v1alpha1_update_route_of_area_payload: Request an update of a network route. (required) + :type v1alpha1_update_route_of_area_payload: V1alpha1UpdateRouteOfAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -24531,10 +36582,11 @@ def update_volume( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_volume_serialize( - project_id=project_id, - volume_id=volume_id, - update_volume_payload=update_volume_payload, + _param = self._v1alpha1_update_route_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + v1alpha1_update_route_of_area_payload=v1alpha1_update_route_of_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -24542,7 +36594,7 @@ def update_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -24557,17 +36609,26 @@ def update_volume( ).data @validate_call - def update_volume_with_http_info( + def v1alpha1_update_route_of_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." + ), ], - volume_id: Annotated[ + area_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 Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + v1alpha1_update_route_of_area_payload: Annotated[ + V1alpha1UpdateRouteOfAreaPayload, Field(description="Request an update of a network route.") ], - update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -24577,17 +36638,19 @@ def update_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]: - """Update information of a volume. + ) -> ApiResponse[Route]: + """Update a network route. - Update name, description or labels of the volume. + Update a network route defined in a network area. - :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 update_volume_payload: Request an update of a volume. (required) - :type update_volume_payload: UpdateVolumePayload + :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 v1alpha1_update_route_of_area_payload: Request an update of a network route. (required) + :type v1alpha1_update_route_of_area_payload: V1alpha1UpdateRouteOfAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -24610,10 +36673,11 @@ def update_volume_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_volume_serialize( - project_id=project_id, - volume_id=volume_id, - update_volume_payload=update_volume_payload, + _param = self._v1alpha1_update_route_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + v1alpha1_update_route_of_area_payload=v1alpha1_update_route_of_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -24621,7 +36685,7 @@ def update_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -24636,17 +36700,26 @@ def update_volume_with_http_info( ) @validate_call - def update_volume_without_preload_content( + def v1alpha1_update_route_of_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." + ), ], - volume_id: Annotated[ + area_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 Area." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + v1alpha1_update_route_of_area_payload: Annotated[ + V1alpha1UpdateRouteOfAreaPayload, Field(description="Request an update of a network route.") ], - update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -24657,16 +36730,18 @@ def update_volume_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update information of a volume. + """Update a network route. - Update name, description or labels of the volume. + Update a network route defined in a network area. - :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 update_volume_payload: Request an update of a volume. (required) - :type update_volume_payload: UpdateVolumePayload + :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 v1alpha1_update_route_of_area_payload: Request an update of a network route. (required) + :type v1alpha1_update_route_of_area_payload: V1alpha1UpdateRouteOfAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -24689,10 +36764,11 @@ def update_volume_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_volume_serialize( - project_id=project_id, - volume_id=volume_id, - update_volume_payload=update_volume_payload, + _param = self._v1alpha1_update_route_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + route_id=route_id, + v1alpha1_update_route_of_area_payload=v1alpha1_update_route_of_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -24700,7 +36776,7 @@ def update_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -24710,11 +36786,12 @@ def update_volume_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_volume_serialize( + def _v1alpha1_update_route_of_area_serialize( self, - project_id, - volume_id, - update_volume_payload, + organization_id, + area_id, + route_id, + v1alpha1_update_route_of_area_payload, _request_auth, _content_type, _headers, @@ -24733,16 +36810,18 @@ def _update_volume_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if volume_id is not None: - _path_params["volumeId"] = volume_id + if 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 - if update_volume_payload is not None: - _body_params = update_volume_payload + if v1alpha1_update_route_of_area_payload is not None: + _body_params = v1alpha1_update_route_of_area_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -24761,7 +36840,7 @@ def _update_volume_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}", + resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py b/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py index 6882f387..83647c52 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py @@ -21,18 +21,47 @@ from stackit.iaasalpha.models.add_volume_to_server_payload import ( AddVolumeToServerPayload, ) +from stackit.iaasalpha.models.affinity_group import AffinityGroup +from stackit.iaasalpha.models.affinity_group_list_response import ( + AffinityGroupListResponse, +) from stackit.iaasalpha.models.allowed_addresses_inner import AllowedAddressesInner from stackit.iaasalpha.models.area import Area from stackit.iaasalpha.models.area_config import AreaConfig from stackit.iaasalpha.models.area_id import AreaId from stackit.iaasalpha.models.area_prefix_config_ipv4 import AreaPrefixConfigIPv4 +from stackit.iaasalpha.models.availability_zone_list_response import ( + AvailabilityZoneListResponse, +) +from stackit.iaasalpha.models.backup import Backup +from stackit.iaasalpha.models.backup_list_response import BackupListResponse +from stackit.iaasalpha.models.backup_source import BackupSource from stackit.iaasalpha.models.base_security_group_rule import BaseSecurityGroupRule from stackit.iaasalpha.models.boot_volume import BootVolume from stackit.iaasalpha.models.boot_volume_source import BootVolumeSource +from stackit.iaasalpha.models.create_affinity_group_payload import ( + CreateAffinityGroupPayload, +) from stackit.iaasalpha.models.create_area_address_family import CreateAreaAddressFamily from stackit.iaasalpha.models.create_area_ipv4 import CreateAreaIPv4 +from stackit.iaasalpha.models.create_backup_payload import CreateBackupPayload from stackit.iaasalpha.models.create_image_payload import CreateImagePayload from stackit.iaasalpha.models.create_key_pair_payload import CreateKeyPairPayload +from stackit.iaasalpha.models.create_network_address_family import ( + CreateNetworkAddressFamily, +) +from stackit.iaasalpha.models.create_network_area_payload import ( + CreateNetworkAreaPayload, +) +from stackit.iaasalpha.models.create_network_area_range_payload import ( + CreateNetworkAreaRangePayload, +) +from stackit.iaasalpha.models.create_network_area_route_payload import ( + CreateNetworkAreaRoutePayload, +) +from stackit.iaasalpha.models.create_network_ipv4_body import CreateNetworkIPv4Body +from stackit.iaasalpha.models.create_network_ipv6_body import CreateNetworkIPv6Body +from stackit.iaasalpha.models.create_network_payload import CreateNetworkPayload from stackit.iaasalpha.models.create_nic_payload import CreateNicPayload from stackit.iaasalpha.models.create_protocol import CreateProtocol from stackit.iaasalpha.models.create_public_ip_payload import CreatePublicIPPayload @@ -53,17 +82,19 @@ from stackit.iaasalpha.models.create_server_payload_networking import ( CreateServerPayloadNetworking, ) +from stackit.iaasalpha.models.create_snapshot_payload import CreateSnapshotPayload from stackit.iaasalpha.models.create_virtual_ip_payload import CreateVirtualIPPayload from stackit.iaasalpha.models.create_volume_payload import CreateVolumePayload from stackit.iaasalpha.models.error import Error from stackit.iaasalpha.models.get_server_log200_response import GetServerLog200Response -from stackit.iaasalpha.models.get_server_log_request import GetServerLogRequest from stackit.iaasalpha.models.icmp_parameters import ICMPParameters from stackit.iaasalpha.models.image import Image from stackit.iaasalpha.models.image_checksum import ImageChecksum from stackit.iaasalpha.models.image_config import ImageConfig from stackit.iaasalpha.models.image_create_response import ImageCreateResponse from stackit.iaasalpha.models.image_list_response import ImageListResponse +from stackit.iaasalpha.models.image_share import ImageShare +from stackit.iaasalpha.models.image_share_consumer import ImageShareConsumer from stackit.iaasalpha.models.key_pair_list_response import KeyPairListResponse from stackit.iaasalpha.models.keypair import Keypair from stackit.iaasalpha.models.machine_type import MachineType @@ -74,8 +105,17 @@ from stackit.iaasalpha.models.network_area_list_response import NetworkAreaListResponse from stackit.iaasalpha.models.network_list_response import NetworkListResponse from stackit.iaasalpha.models.network_range import NetworkRange +from stackit.iaasalpha.models.network_range_list_response import ( + NetworkRangeListResponse, +) from stackit.iaasalpha.models.nic import NIC from stackit.iaasalpha.models.nic_list_response import NICListResponse +from stackit.iaasalpha.models.partial_update_network_area_payload import ( + PartialUpdateNetworkAreaPayload, +) +from stackit.iaasalpha.models.partial_update_network_payload import ( + PartialUpdateNetworkPayload, +) from stackit.iaasalpha.models.port_range import PortRange from stackit.iaasalpha.models.project import Project from stackit.iaasalpha.models.project_list_response import ProjectListResponse @@ -86,6 +126,9 @@ from stackit.iaasalpha.models.public_network_list_response import ( PublicNetworkListResponse, ) +from stackit.iaasalpha.models.quota import Quota +from stackit.iaasalpha.models.quota_list import QuotaList +from stackit.iaasalpha.models.quota_list_response import QuotaListResponse from stackit.iaasalpha.models.remove_member_from_virtual_ip_payload import ( RemoveMemberFromVirtualIPPayload, ) @@ -95,6 +138,7 @@ from stackit.iaasalpha.models.resize_server_payload import ResizeServerPayload from stackit.iaasalpha.models.resize_volume_payload import ResizeVolumePayload from stackit.iaasalpha.models.route import Route +from stackit.iaasalpha.models.route_list_response import RouteListResponse from stackit.iaasalpha.models.security_group import SecurityGroup from stackit.iaasalpha.models.security_group_list_response import ( SecurityGroupListResponse, @@ -114,22 +158,36 @@ from stackit.iaasalpha.models.service_account_mail_list_response import ( ServiceAccountMailListResponse, ) +from stackit.iaasalpha.models.set_image_share_payload import SetImageSharePayload +from stackit.iaasalpha.models.snapshot import Snapshot +from stackit.iaasalpha.models.snapshot_list_response import SnapshotListResponse from stackit.iaasalpha.models.static_area_id import StaticAreaID from stackit.iaasalpha.models.update_area_address_family import UpdateAreaAddressFamily from stackit.iaasalpha.models.update_area_ipv4 import UpdateAreaIPv4 from stackit.iaasalpha.models.update_attached_volume_payload import ( UpdateAttachedVolumePayload, ) +from stackit.iaasalpha.models.update_backup_payload import UpdateBackupPayload from stackit.iaasalpha.models.update_image_payload import UpdateImagePayload +from stackit.iaasalpha.models.update_image_share_payload import UpdateImageSharePayload from stackit.iaasalpha.models.update_key_pair_payload import UpdateKeyPairPayload +from stackit.iaasalpha.models.update_network_address_family import ( + UpdateNetworkAddressFamily, +) +from stackit.iaasalpha.models.update_network_ipv4_body import UpdateNetworkIPv4Body +from stackit.iaasalpha.models.update_network_ipv6_body import UpdateNetworkIPv6Body from stackit.iaasalpha.models.update_nic_payload import UpdateNicPayload from stackit.iaasalpha.models.update_public_ip_payload import UpdatePublicIPPayload from stackit.iaasalpha.models.update_security_group_payload import ( UpdateSecurityGroupPayload, ) from stackit.iaasalpha.models.update_server_payload import UpdateServerPayload +from stackit.iaasalpha.models.update_snapshot_payload import UpdateSnapshotPayload from stackit.iaasalpha.models.update_virtual_ip_payload import UpdateVirtualIPPayload from stackit.iaasalpha.models.update_volume_payload import UpdateVolumePayload +from stackit.iaasalpha.models.v1alpha1_update_route_of_area_payload import ( + V1alpha1UpdateRouteOfAreaPayload, +) from stackit.iaasalpha.models.virtual_ip import VirtualIp from stackit.iaasalpha.models.virtual_ip_list_response import VirtualIpListResponse from stackit.iaasalpha.models.volume import Volume diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/affinity_group.py b/services/iaasalpha/src/stackit/iaasalpha/models/affinity_group.py new file mode 100644 index 00000000..1ae1e5a6 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class 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/iaasalpha/src/stackit/iaasalpha/models/affinity_group_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/affinity_group_list_response.py new file mode 100644 index 00000000..8ad1d1fd --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaasalpha.models.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/iaasalpha/src/stackit/iaasalpha/models/availability_zone_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/availability_zone_list_response.py new file mode 100644 index 00000000..e06a8a14 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/availability_zone_list_response.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class AvailabilityZoneListResponse(BaseModel): + """ + Availability Zone list response. + """ + + items: List[StrictStr] = Field(description="A list of availability zones.") + __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 AvailabilityZoneListResponse 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 AvailabilityZoneListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"items": obj.get("items")}) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/backup.py b/services/iaasalpha/src/stackit/iaasalpha/models/backup.py new file mode 100644 index 00000000..88961577 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, 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/iaasalpha/src/stackit/iaasalpha/models/backup_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/backup_list_response.py new file mode 100644 index 00000000..db402242 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaasalpha.models.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/iaasalpha/src/stackit/iaasalpha/models/backup_source.py b/services/iaasalpha/src/stackit/iaasalpha/models/backup_source.py new file mode 100644 index 00000000..4d34adc4 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class 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/iaasalpha/src/stackit/iaasalpha/models/create_affinity_group_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_affinity_group_payload.py new file mode 100644 index 00000000..de287fbe --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class 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/iaasalpha/src/stackit/iaasalpha/models/create_backup_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_backup_payload.py new file mode 100644 index 00000000..679dbd68 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.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/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py index 0c0725c3..8b208a51 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py @@ -57,6 +57,9 @@ class CreateImagePayload(BaseModel): 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.") @@ -73,6 +76,7 @@ class CreateImagePayload(BaseModel): "minDiskSize", "minRam", "name", + "owner", "protected", "scope", "status", @@ -98,6 +102,18 @@ def name_validate_regular_expression(cls, 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, @@ -133,12 +149,14 @@ 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( [ "checksum", "created_at", "id", + "owner", "scope", "status", "updated_at", @@ -178,6 +196,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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"), diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_address_family.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_address_family.py new file mode 100644 index 00000000..c6b4c12b --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_address_family.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from typing_extensions import Self + +from stackit.iaasalpha.models.create_network_ipv4_body import CreateNetworkIPv4Body +from stackit.iaasalpha.models.create_network_ipv6_body import CreateNetworkIPv6Body + + +class CreateNetworkAddressFamily(BaseModel): + """ + The addressFamily object for a network create request. + """ + + ipv4: Optional[CreateNetworkIPv4Body] = None + ipv6: Optional[CreateNetworkIPv6Body] = None + __properties: ClassVar[List[str]] = ["ipv4", "ipv6"] + + 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 CreateNetworkAddressFamily 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 ipv4 + if self.ipv4: + _dict["ipv4"] = self.ipv4.to_dict() + # override the default output from pydantic by calling `to_dict()` of ipv6 + if self.ipv6: + _dict["ipv6"] = self.ipv6.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNetworkAddressFamily from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "ipv4": CreateNetworkIPv4Body.from_dict(obj["ipv4"]) if obj.get("ipv4") is not None else None, + "ipv6": CreateNetworkIPv6Body.from_dict(obj["ipv6"]) if obj.get("ipv6") is not None else None, + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_payload.py new file mode 100644 index 00000000..06ab0f56 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_payload.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.create_area_address_family import CreateAreaAddressFamily + + +class CreateNetworkAreaPayload(BaseModel): + """ + CreateNetworkAreaPayload + """ + + address_family: CreateAreaAddressFamily = Field(alias="addressFamily") + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + __properties: ClassVar[List[str]] = ["addressFamily", "labels", "name"] + + @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 CreateNetworkAreaPayload 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 address_family + if self.address_family: + _dict["addressFamily"] = self.address_family.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNetworkAreaPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "addressFamily": ( + CreateAreaAddressFamily.from_dict(obj["addressFamily"]) + if obj.get("addressFamily") is not None + else None + ), + "labels": obj.get("labels"), + "name": obj.get("name"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_range_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_range_payload.py new file mode 100644 index 00000000..8ba9c7ac --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_range_payload.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.network_range import NetworkRange + + +class CreateNetworkAreaRangePayload(BaseModel): + """ + CreateNetworkAreaRangePayload + """ + + ipv4: Optional[Annotated[List[NetworkRange], Field(min_length=1, max_length=64)]] = Field( + default=None, description="A list of network ranges." + ) + __properties: ClassVar[List[str]] = ["ipv4"] + + 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 CreateNetworkAreaRangePayload 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 ipv4 (list) + _items = [] + if self.ipv4: + for _item in self.ipv4: + if _item: + _items.append(_item.to_dict()) + _dict["ipv4"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNetworkAreaRangePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"ipv4": [NetworkRange.from_dict(_item) for _item in obj["ipv4"]] if obj.get("ipv4") is not None else None} + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_route_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_route_payload.py new file mode 100644 index 00000000..59291039 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_route_payload.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaasalpha.models.route import Route + + +class CreateNetworkAreaRoutePayload(BaseModel): + """ + CreateNetworkAreaRoutePayload + """ + + ipv4: Optional[List[Route]] = Field(default=None, description="A list of routes.") + __properties: ClassVar[List[str]] = ["ipv4"] + + 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 CreateNetworkAreaRoutePayload 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 ipv4 (list) + _items = [] + if self.ipv4: + for _item in self.ipv4: + if _item: + _items.append(_item.to_dict()) + _dict["ipv4"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNetworkAreaRoutePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"ipv4": [Route.from_dict(_item) for _item in obj["ipv4"]] if obj.get("ipv4") is not None else None} + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_body.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_body.py new file mode 100644 index 00000000..d3f3335e --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_body.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class CreateNetworkIPv4Body(BaseModel): + """ + The config object for an IPv4 network. + """ + + gateway: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, + description="The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.", + ) + nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( + default=None, description="A list containing DNS Servers/Nameservers for IPv4." + ) + prefix: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, description="Classless Inter-Domain Routing (CIDR)." + ) + prefix_length: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field(default=None, alias="prefixLength") + __properties: ClassVar[List[str]] = ["gateway", "nameservers", "prefix", "prefixLength"] + + @field_validator("gateway") + def gateway_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match( + r"((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))", + value, + ): + raise ValueError( + r"must validate the regular expression /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/" + ) + return value + + @field_validator("prefix") + def prefix_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match( + r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$", + value, + ): + raise ValueError( + r"must validate the regular expression /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/" + ) + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateNetworkIPv4Body 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 gateway (nullable) is None + # and model_fields_set contains the field + if self.gateway is None and "gateway" in self.model_fields_set: + _dict["gateway"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNetworkIPv4Body from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "gateway": obj.get("gateway"), + "nameservers": obj.get("nameservers"), + "prefix": obj.get("prefix"), + "prefixLength": obj.get("prefixLength"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_body.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_body.py new file mode 100644 index 00000000..32197535 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_body.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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class CreateNetworkIPv6Body(BaseModel): + """ + The config object for an IPv6 network. + """ + + gateway: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, + description="The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.", + ) + nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( + default=None, description="A list containing DNS Servers/Nameservers for IPv6." + ) + prefix: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, description="Classless Inter-Domain Routing (CIDR) for IPv6." + ) + prefix_length: Optional[Annotated[int, Field(le=128, strict=True, ge=56)]] = Field( + default=None, alias="prefixLength" + ) + __properties: ClassVar[List[str]] = ["gateway", "nameservers", "prefix", "prefixLength"] + + @field_validator("gateway") + def gateway_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match( + r"((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))", + value, + ): + raise ValueError( + r"must validate the regular expression /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/" + ) + return value + + @field_validator("prefix") + def prefix_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match( + r"^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$", + value, + ): + raise ValueError( + r"must validate the regular expression /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/" + ) + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateNetworkIPv6Body 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 gateway (nullable) is None + # and model_fields_set contains the field + if self.gateway is None and "gateway" in self.model_fields_set: + _dict["gateway"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNetworkIPv6Body from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "gateway": obj.get("gateway"), + "nameservers": obj.get("nameservers"), + "prefix": obj.get("prefix"), + "prefixLength": obj.get("prefixLength"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_payload.py new file mode 100644 index 00000000..490475a2 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_payload.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.create_network_address_family import ( + CreateNetworkAddressFamily, +) + + +class CreateNetworkPayload(BaseModel): + """ + Object that represents the request body for a network create. + """ + + address_family: Optional[CreateNetworkAddressFamily] = Field(default=None, alias="addressFamily") + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + name: Annotated[str, Field(strict=True, max_length=63)] = Field( + description="The name for a General Object. Matches Names and also UUIDs." + ) + routed: Optional[StrictBool] = Field( + default=None, description="Shows if the network is routed and therefore accessible from other networks." + ) + __properties: ClassVar[List[str]] = ["addressFamily", "labels", "name", "routed"] + + @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 CreateNetworkPayload 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 address_family + if self.address_family: + _dict["addressFamily"] = self.address_family.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNetworkPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "addressFamily": ( + CreateNetworkAddressFamily.from_dict(obj["addressFamily"]) + if obj.get("addressFamily") is not None + else None + ), + "labels": obj.get("labels"), + "name": obj.get("name"), + "routed": obj.get("routed"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_snapshot_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_snapshot_payload.py new file mode 100644 index 00000000..a4f9020f --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, 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/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py index bd617cdb..94f73b64 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py @@ -31,6 +31,7 @@ ) from typing_extensions import Annotated, Self +from stackit.iaasalpha.models.image_config import ImageConfig from stackit.iaasalpha.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/iaasalpha/src/stackit/iaasalpha/models/image.py b/services/iaasalpha/src/stackit/iaasalpha/models/image.py index fc5f012c..aef2d251 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/image.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/image.py @@ -57,6 +57,9 @@ class Image(BaseModel): 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.") @@ -73,6 +76,7 @@ class Image(BaseModel): "minDiskSize", "minRam", "name", + "owner", "protected", "scope", "status", @@ -98,6 +102,18 @@ def name_validate_regular_expression(cls, 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, @@ -133,12 +149,14 @@ 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( [ "checksum", "created_at", "id", + "owner", "scope", "status", "updated_at", @@ -178,6 +196,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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"), diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_share.py b/services/iaasalpha/src/stackit/iaasalpha/models/image_share.py new file mode 100644 index 00000000..982493ad --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +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/iaasalpha/src/stackit/iaasalpha/models/image_share_consumer.py b/services/iaasalpha/src/stackit/iaasalpha/models/image_share_consumer.py new file mode 100644 index 00000000..6f667cfd --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, 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/iaasalpha/src/stackit/iaasalpha/models/network_range_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/network_range_list_response.py new file mode 100644 index 00000000..3a723950 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/network_range_list_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.network_range import NetworkRange + + +class NetworkRangeListResponse(BaseModel): + """ + Network Range list response. + """ + + items: Annotated[List[NetworkRange], Field(min_length=1, max_length=64)] = Field( + description="A list of network ranges." + ) + __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 NetworkRangeListResponse 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 NetworkRangeListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "items": ( + [NetworkRange.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ) + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_area_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_area_payload.py new file mode 100644 index 00000000..b3d556b4 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_area_payload.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.update_area_address_family import UpdateAreaAddressFamily + + +class PartialUpdateNetworkAreaPayload(BaseModel): + """ + PartialUpdateNetworkAreaPayload + """ + + address_family: Optional[UpdateAreaAddressFamily] = Field(default=None, alias="addressFamily") + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + 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]] = ["addressFamily", "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 PartialUpdateNetworkAreaPayload 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 address_family + if self.address_family: + _dict["addressFamily"] = self.address_family.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartialUpdateNetworkAreaPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "addressFamily": ( + UpdateAreaAddressFamily.from_dict(obj["addressFamily"]) + if obj.get("addressFamily") is not None + else None + ), + "labels": obj.get("labels"), + "name": obj.get("name"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_payload.py new file mode 100644 index 00000000..635b4f87 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from typing_extensions import Annotated, Self + +from stackit.iaasalpha.models.update_network_address_family import ( + UpdateNetworkAddressFamily, +) + + +class PartialUpdateNetworkPayload(BaseModel): + """ + Object that represents the request body for a network update. + """ + + address_family: Optional[UpdateNetworkAddressFamily] = Field(default=None, alias="addressFamily") + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." + ) + 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." + ) + routed: Optional[StrictBool] = Field( + default=None, description="Shows if the network is routed and therefore accessible from other networks." + ) + __properties: ClassVar[List[str]] = ["addressFamily", "labels", "name", "routed"] + + @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 PartialUpdateNetworkPayload 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 address_family + if self.address_family: + _dict["addressFamily"] = self.address_family.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartialUpdateNetworkPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "addressFamily": ( + UpdateNetworkAddressFamily.from_dict(obj["addressFamily"]) + if obj.get("addressFamily") is not None + else None + ), + "labels": obj.get("labels"), + "name": obj.get("name"), + "routed": obj.get("routed"), + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/quota.py b/services/iaasalpha/src/stackit/iaasalpha/models/quota.py new file mode 100644 index 00000000..b913f15a --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, 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/iaasalpha/src/stackit/iaasalpha/models/quota_list.py b/services/iaasalpha/src/stackit/iaasalpha/models/quota_list.py new file mode 100644 index 00000000..fb49e9b5 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaasalpha.models.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/iaasalpha/src/stackit/iaasalpha/models/quota_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/quota_list_response.py new file mode 100644 index 00000000..980f9842 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from typing_extensions import Self + +from stackit.iaasalpha.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/iaasalpha/src/stackit/iaasalpha/models/route_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/route_list_response.py new file mode 100644 index 00000000..2016bf76 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/route_list_response.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaasalpha.models.route import Route + + +class RouteListResponse(BaseModel): + """ + Route list response. + """ + + items: List[Route] = Field(description="A list of routes.") + __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 RouteListResponse 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 RouteListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"items": [Route.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None} + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/set_image_share_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/set_image_share_payload.py new file mode 100644 index 00000000..426ac32d --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +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/iaasalpha/src/stackit/iaasalpha/models/snapshot.py b/services/iaasalpha/src/stackit/iaasalpha/models/snapshot.py new file mode 100644 index 00000000..c7c1198a --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, 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/iaasalpha/src/stackit/iaasalpha/models/snapshot_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/snapshot_list_response.py new file mode 100644 index 00000000..6c72e2fc --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.iaasalpha.models.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/iaasalpha/src/stackit/iaasalpha/models/update_backup_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_backup_payload.py new file mode 100644 index 00000000..a70da4a4 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, 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/iaasalpha/src/stackit/iaasalpha/models/update_image_share_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_image_share_payload.py new file mode 100644 index 00000000..0baf12ba --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +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/iaasalpha/src/stackit/iaasalpha/models/update_network_address_family.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_network_address_family.py new file mode 100644 index 00000000..29becda0 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_network_address_family.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from typing_extensions import Self + +from stackit.iaasalpha.models.update_network_ipv4_body import UpdateNetworkIPv4Body +from stackit.iaasalpha.models.update_network_ipv6_body import UpdateNetworkIPv6Body + + +class UpdateNetworkAddressFamily(BaseModel): + """ + The addressFamily object for a network update request. + """ + + ipv4: Optional[UpdateNetworkIPv4Body] = None + ipv6: Optional[UpdateNetworkIPv6Body] = None + __properties: ClassVar[List[str]] = ["ipv4", "ipv6"] + + 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 UpdateNetworkAddressFamily 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 ipv4 + if self.ipv4: + _dict["ipv4"] = self.ipv4.to_dict() + # override the default output from pydantic by calling `to_dict()` of ipv6 + if self.ipv6: + _dict["ipv6"] = self.ipv6.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateNetworkAddressFamily from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "ipv4": UpdateNetworkIPv4Body.from_dict(obj["ipv4"]) if obj.get("ipv4") is not None else None, + "ipv6": UpdateNetworkIPv6Body.from_dict(obj["ipv6"]) if obj.get("ipv6") is not None else None, + } + ) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv4_body.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv4_body.py new file mode 100644 index 00000000..e25eb64a --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv4_body.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class UpdateNetworkIPv4Body(BaseModel): + """ + The config object for a IPv4 network update. + """ + + gateway: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, + description="The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.", + ) + nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( + default=None, description="A list containing DNS Servers/Nameservers for IPv4." + ) + __properties: ClassVar[List[str]] = ["gateway", "nameservers"] + + @field_validator("gateway") + def gateway_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match( + r"((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))", + value, + ): + raise ValueError( + r"must validate the regular expression /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/" + ) + 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 UpdateNetworkIPv4Body 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 gateway (nullable) is None + # and model_fields_set contains the field + if self.gateway is None and "gateway" in self.model_fields_set: + _dict["gateway"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateNetworkIPv4Body from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"gateway": obj.get("gateway"), "nameservers": obj.get("nameservers")}) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv6_body.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv6_body.py new file mode 100644 index 00000000..45b21bf9 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv6_body.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class UpdateNetworkIPv6Body(BaseModel): + """ + The config object for a IPv6 network update. + """ + + gateway: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, + description="The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.", + ) + nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( + default=None, description="A list containing DNS Servers/Nameservers for IPv6." + ) + __properties: ClassVar[List[str]] = ["gateway", "nameservers"] + + @field_validator("gateway") + def gateway_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match( + r"((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))", + value, + ): + raise ValueError( + r"must validate the regular expression /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/" + ) + 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 UpdateNetworkIPv6Body 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 gateway (nullable) is None + # and model_fields_set contains the field + if self.gateway is None and "gateway" in self.model_fields_set: + _dict["gateway"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateNetworkIPv6Body from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"gateway": obj.get("gateway"), "nameservers": obj.get("nameservers")}) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_snapshot_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_snapshot_payload.py new file mode 100644 index 00000000..81a620db --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/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: 1alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, 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/iaasalpha/src/stackit/iaasalpha/models/update_volume_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_volume_payload.py index c4f405d8..e2944c58 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_volume_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/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.iaasalpha.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/iaasalpha/src/stackit/iaasalpha/models/get_server_log_request.py b/services/iaasalpha/src/stackit/iaasalpha/models/v1alpha1_update_route_of_area_payload.py similarity index 78% rename from services/iaasalpha/src/stackit/iaasalpha/models/get_server_log_request.py rename to services/iaasalpha/src/stackit/iaasalpha/models/v1alpha1_update_route_of_area_payload.py index f0c28c57..d4c3d0c6 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/get_server_log_request.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/v1alpha1_update_route_of_area_payload.py @@ -19,18 +19,18 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self +from typing_extensions import Self -class GetServerLogRequest(BaseModel): +class V1alpha1UpdateRouteOfAreaPayload(BaseModel): """ - GetServerLogRequest + Object that represents the request body for a route update. """ - length: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( - default=2000, description="Set to 0 to retrieve the complete log." + labels: Optional[Dict[str, Any]] = Field( + default=None, description="Object that represents the labels of an object." ) - __properties: ClassVar[List[str]] = ["length"] + __properties: ClassVar[List[str]] = ["labels"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +49,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 V1alpha1UpdateRouteOfAreaPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,12 +73,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 V1alpha1UpdateRouteOfAreaPayload 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({"labels": obj.get("labels")}) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/volume.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume.py index 91cf9c70..26b0f040 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/volume.py @@ -31,6 +31,7 @@ ) from typing_extensions import Annotated, Self +from stackit.iaasalpha.models.image_config import ImageConfig from stackit.iaasalpha.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"),