diff --git a/services/iaasalpha/src/stackit/iaasalpha/__init__.py b/services/iaasalpha/src/stackit/iaasalpha/__init__.py index 22f42920..25f5be7d 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/__init__.py +++ b/services/iaasalpha/src/stackit/iaasalpha/__init__.py @@ -7,216 +7,146 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AddRoutesToRoutingTablePayload", + "AddRoutingTableToAreaPayload", + "CreateNetworkIPv4", + "CreateNetworkIPv4WithPrefix", + "CreateNetworkIPv4WithPrefixLength", + "CreateNetworkIPv6", + "CreateNetworkIPv6WithPrefix", + "CreateNetworkIPv6WithPrefixLength", + "CreateNetworkPayload", + "DestinationCIDRv4", + "DestinationCIDRv6", + "Error", + "Network", + "NetworkIPv4", + "NetworkIPv6", + "NetworkListResponse", + "NexthopBlackhole", + "NexthopIPv4", + "NexthopIPv6", + "NexthopInternet", + "PartialUpdateNetworkPayload", + "Route", + "RouteDestination", + "RouteListResponse", + "RouteNexthop", + "RoutingTable", + "RoutingTableListResponse", + "UpdateNetworkIPv4Body", + "UpdateNetworkIPv6Body", + "UpdateRouteOfRoutingTablePayload", + "UpdateRoutingTableOfAreaPayload", +] + # import apis into sdk package -from stackit.iaasalpha.api.default_api import DefaultApi -from stackit.iaasalpha.api_client import ApiClient +from stackit.iaasalpha.api.default_api import DefaultApi as DefaultApi +from stackit.iaasalpha.api_client import ApiClient as ApiClient # import ApiClient -from stackit.iaasalpha.api_response import ApiResponse -from stackit.iaasalpha.configuration import HostConfiguration -from stackit.iaasalpha.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.iaasalpha.api_response import ApiResponse as ApiResponse +from stackit.iaasalpha.configuration import HostConfiguration as HostConfiguration +from stackit.iaasalpha.exceptions import ApiAttributeError as ApiAttributeError +from stackit.iaasalpha.exceptions import ApiException as ApiException +from stackit.iaasalpha.exceptions import ApiKeyError as ApiKeyError +from stackit.iaasalpha.exceptions import ApiTypeError as ApiTypeError +from stackit.iaasalpha.exceptions import ApiValueError as ApiValueError +from stackit.iaasalpha.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.iaasalpha.models.add_member_to_virtual_ip_payload import ( - AddMemberToVirtualIPPayload, -) -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 -from stackit.iaasalpha.models.create_security_group_payload import ( - CreateSecurityGroupPayload, -) -from stackit.iaasalpha.models.create_security_group_rule_payload import ( - CreateSecurityGroupRulePayload, -) -from stackit.iaasalpha.models.create_security_group_rule_protocol import ( - CreateSecurityGroupRuleProtocol, -) -from stackit.iaasalpha.models.create_server_networking import CreateServerNetworking -from stackit.iaasalpha.models.create_server_networking_with_nics import ( - CreateServerNetworkingWithNics, -) -from stackit.iaasalpha.models.create_server_payload import CreateServerPayload -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.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 -from stackit.iaasalpha.models.machine_type_list_response import MachineTypeListResponse -from stackit.iaasalpha.models.network import Network -from stackit.iaasalpha.models.network_area import NetworkArea -from stackit.iaasalpha.models.network_area_ipv4 import NetworkAreaIPv4 -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.add_routes_to_routing_table_payload import ( + AddRoutesToRoutingTablePayload as AddRoutesToRoutingTablePayload, +) +from stackit.iaasalpha.models.add_routing_table_to_area_payload import ( + AddRoutingTableToAreaPayload as AddRoutingTableToAreaPayload, +) +from stackit.iaasalpha.models.create_network_ipv4 import ( + CreateNetworkIPv4 as CreateNetworkIPv4, +) +from stackit.iaasalpha.models.create_network_ipv4_with_prefix import ( + CreateNetworkIPv4WithPrefix as CreateNetworkIPv4WithPrefix, +) +from stackit.iaasalpha.models.create_network_ipv4_with_prefix_length import ( + CreateNetworkIPv4WithPrefixLength as CreateNetworkIPv4WithPrefixLength, +) +from stackit.iaasalpha.models.create_network_ipv6 import ( + CreateNetworkIPv6 as CreateNetworkIPv6, +) +from stackit.iaasalpha.models.create_network_ipv6_with_prefix import ( + CreateNetworkIPv6WithPrefix as CreateNetworkIPv6WithPrefix, +) +from stackit.iaasalpha.models.create_network_ipv6_with_prefix_length import ( + CreateNetworkIPv6WithPrefixLength as CreateNetworkIPv6WithPrefixLength, +) +from stackit.iaasalpha.models.create_network_payload import ( + CreateNetworkPayload as CreateNetworkPayload, +) +from stackit.iaasalpha.models.destination_cidrv4 import ( + DestinationCIDRv4 as DestinationCIDRv4, ) +from stackit.iaasalpha.models.destination_cidrv6 import ( + DestinationCIDRv6 as DestinationCIDRv6, +) +from stackit.iaasalpha.models.error import Error as Error +from stackit.iaasalpha.models.network import Network as Network +from stackit.iaasalpha.models.network_ipv4 import NetworkIPv4 as NetworkIPv4 +from stackit.iaasalpha.models.network_ipv6 import NetworkIPv6 as NetworkIPv6 +from stackit.iaasalpha.models.network_list_response import ( + NetworkListResponse as NetworkListResponse, +) +from stackit.iaasalpha.models.nexthop_blackhole import ( + NexthopBlackhole as NexthopBlackhole, +) +from stackit.iaasalpha.models.nexthop_internet import NexthopInternet as NexthopInternet +from stackit.iaasalpha.models.nexthop_ipv4 import NexthopIPv4 as NexthopIPv4 +from stackit.iaasalpha.models.nexthop_ipv6 import NexthopIPv6 as NexthopIPv6 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 -from stackit.iaasalpha.models.protocol import Protocol -from stackit.iaasalpha.models.public_ip import PublicIp -from stackit.iaasalpha.models.public_ip_list_response import PublicIpListResponse -from stackit.iaasalpha.models.public_network import PublicNetwork -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, -) -from stackit.iaasalpha.models.request import Request -from stackit.iaasalpha.models.request_resource import RequestResource -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, -) -from stackit.iaasalpha.models.security_group_rule import SecurityGroupRule -from stackit.iaasalpha.models.security_group_rule_list_response import ( - SecurityGroupRuleListResponse, -) -from stackit.iaasalpha.models.security_group_rule_protocol import ( - SecurityGroupRuleProtocol, -) -from stackit.iaasalpha.models.server import Server -from stackit.iaasalpha.models.server_console_url import ServerConsoleUrl -from stackit.iaasalpha.models.server_list_response import ServerListResponse -from stackit.iaasalpha.models.server_maintenance import ServerMaintenance -from stackit.iaasalpha.models.server_network import ServerNetwork -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 -from stackit.iaasalpha.models.volume_attachment import VolumeAttachment -from stackit.iaasalpha.models.volume_attachment_list_response import ( - VolumeAttachmentListResponse, -) -from stackit.iaasalpha.models.volume_list_response import VolumeListResponse -from stackit.iaasalpha.models.volume_performance_class import VolumePerformanceClass -from stackit.iaasalpha.models.volume_performance_class_list_response import ( - VolumePerformanceClassListResponse, -) -from stackit.iaasalpha.models.volume_source import VolumeSource + PartialUpdateNetworkPayload as PartialUpdateNetworkPayload, +) +from stackit.iaasalpha.models.route import Route as Route +from stackit.iaasalpha.models.route_destination import ( + RouteDestination as RouteDestination, +) +from stackit.iaasalpha.models.route_list_response import ( + RouteListResponse as RouteListResponse, +) +from stackit.iaasalpha.models.route_nexthop import RouteNexthop as RouteNexthop +from stackit.iaasalpha.models.routing_table import RoutingTable as RoutingTable +from stackit.iaasalpha.models.routing_table_list_response import ( + RoutingTableListResponse as RoutingTableListResponse, +) +from stackit.iaasalpha.models.update_network_ipv4_body import ( + UpdateNetworkIPv4Body as UpdateNetworkIPv4Body, +) +from stackit.iaasalpha.models.update_network_ipv6_body import ( + UpdateNetworkIPv6Body as UpdateNetworkIPv6Body, +) +from stackit.iaasalpha.models.update_route_of_routing_table_payload import ( + UpdateRouteOfRoutingTablePayload as UpdateRouteOfRoutingTablePayload, +) +from stackit.iaasalpha.models.update_routing_table_of_area_payload import ( + UpdateRoutingTableOfAreaPayload as UpdateRoutingTableOfAreaPayload, +) diff --git a/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py b/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py index 740ec3cd..0dcd7c4a 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py +++ b/services/iaasalpha/src/stackit/iaasalpha/api/default_api.py @@ -5,18 +5,17 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union from pydantic import ( Field, - StrictBool, StrictFloat, StrictInt, StrictStr, @@ -27,139 +26,29 @@ from stackit.iaasalpha.api_client import ApiClient, RequestSerialized from stackit.iaasalpha.api_response import ApiResponse -from stackit.iaasalpha.models.add_member_to_virtual_ip_payload import ( - AddMemberToVirtualIPPayload, +from stackit.iaasalpha.models.add_routes_to_routing_table_payload import ( + AddRoutesToRoutingTablePayload, ) -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.add_routing_table_to_area_payload import ( + AddRoutingTableToAreaPayload, ) 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 ( - CreateSecurityGroupPayload, -) -from stackit.iaasalpha.models.create_security_group_rule_payload import ( - 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.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 -from stackit.iaasalpha.models.machine_type_list_response import MachineTypeListResponse from stackit.iaasalpha.models.network import Network -from stackit.iaasalpha.models.network_area import NetworkArea -from stackit.iaasalpha.models.network_area_list_response import NetworkAreaListResponse 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 -from stackit.iaasalpha.models.public_ip_list_response import PublicIpListResponse -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, -) -from stackit.iaasalpha.models.request import Request -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, -) -from stackit.iaasalpha.models.security_group_rule import SecurityGroupRule -from stackit.iaasalpha.models.security_group_rule_list_response import ( - SecurityGroupRuleListResponse, -) -from stackit.iaasalpha.models.server import Server -from stackit.iaasalpha.models.server_console_url import ServerConsoleUrl -from stackit.iaasalpha.models.server_list_response import ServerListResponse -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 -from stackit.iaasalpha.models.update_security_group_payload import ( - UpdateSecurityGroupPayload, +from stackit.iaasalpha.models.routing_table import RoutingTable +from stackit.iaasalpha.models.routing_table_list_response import ( + RoutingTableListResponse, ) -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.update_route_of_routing_table_payload import ( + UpdateRouteOfRoutingTablePayload, ) -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 -from stackit.iaasalpha.models.volume_attachment import VolumeAttachment -from stackit.iaasalpha.models.volume_attachment_list_response import ( - VolumeAttachmentListResponse, -) -from stackit.iaasalpha.models.volume_list_response import VolumeListResponse -from stackit.iaasalpha.models.volume_performance_class import VolumePerformanceClass -from stackit.iaasalpha.models.volume_performance_class_list_response import ( - VolumePerformanceClassListResponse, +from stackit.iaasalpha.models.update_routing_table_of_area_payload import ( + UpdateRoutingTableOfAreaPayload, ) from stackit.iaasalpha.rest import RESTResponseType @@ -178,21 +67,29 @@ def __init__(self, configuration: Configuration = None) -> None: self.api_client = ApiClient(self.configuration) @validate_call - def add_member_to_virtual_ip( + def add_routes_to_routing_table( 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." + ), ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - add_member_to_virtual_ip_payload: Annotated[ - AddMemberToVirtualIPPayload, Field(description="Request to add a member to a virtual IP.") + add_routes_to_routing_table_payload: Annotated[ + AddRoutesToRoutingTablePayload, Field(description="Request an addition of routes to a routing table.") ], _request_timeout: Union[ None, @@ -203,19 +100,21 @@ def add_member_to_virtual_ip( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VirtualIp: - """Add a member to the virtual IP. + ) -> RouteListResponse: + """Create new routes in a routing table. - Atomically add a member to the virtual IP. + Create new routes in an existing routing table. - :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 add_member_to_virtual_ip_payload: Request to add a member to a virtual IP. (required) - :type add_member_to_virtual_ip_payload: AddMemberToVirtualIPPayload + :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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param add_routes_to_routing_table_payload: Request an addition of routes to a routing table. (required) + :type add_routes_to_routing_table_payload: AddRoutesToRoutingTablePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -236,13 +135,14 @@ def add_member_to_virtual_ip( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_member_to_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - add_member_to_virtual_ip_payload=add_member_to_virtual_ip_payload, + _param = self._add_routes_to_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + add_routes_to_routing_table_payload=add_routes_to_routing_table_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -250,11 +150,12 @@ def add_member_to_virtual_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "201": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -265,21 +166,29 @@ def add_member_to_virtual_ip( ).data @validate_call - def add_member_to_virtual_ip_with_http_info( + def add_routes_to_routing_table_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." + ), ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - add_member_to_virtual_ip_payload: Annotated[ - AddMemberToVirtualIPPayload, Field(description="Request to add a member to a virtual IP.") + add_routes_to_routing_table_payload: Annotated[ + AddRoutesToRoutingTablePayload, Field(description="Request an addition of routes to a routing table.") ], _request_timeout: Union[ None, @@ -290,19 +199,21 @@ def add_member_to_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]: - """Add a member to the virtual IP. + ) -> ApiResponse[RouteListResponse]: + """Create new routes in a routing table. - Atomically add a member to the virtual IP. + Create new routes in an existing routing table. - :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 add_member_to_virtual_ip_payload: Request to add a member to a virtual IP. (required) - :type add_member_to_virtual_ip_payload: AddMemberToVirtualIPPayload + :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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param add_routes_to_routing_table_payload: Request an addition of routes to a routing table. (required) + :type add_routes_to_routing_table_payload: AddRoutesToRoutingTablePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -323,13 +234,14 @@ def add_member_to_virtual_ip_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_member_to_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - add_member_to_virtual_ip_payload=add_member_to_virtual_ip_payload, + _param = self._add_routes_to_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + add_routes_to_routing_table_payload=add_routes_to_routing_table_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -337,11 +249,12 @@ def add_member_to_virtual_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "201": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -352,21 +265,29 @@ def add_member_to_virtual_ip_with_http_info( ) @validate_call - def add_member_to_virtual_ip_without_preload_content( + def add_routes_to_routing_table_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." + ), ], - virtual_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Virtual IP.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - add_member_to_virtual_ip_payload: Annotated[ - AddMemberToVirtualIPPayload, Field(description="Request to add a member to a virtual IP.") + add_routes_to_routing_table_payload: Annotated[ + AddRoutesToRoutingTablePayload, Field(description="Request an addition of routes to a routing table.") ], _request_timeout: Union[ None, @@ -378,18 +299,20 @@ def add_member_to_virtual_ip_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Add a member to the virtual IP. + """Create new routes in a routing table. - Atomically add a member to the virtual IP. + Create new routes in an existing routing table. - :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 add_member_to_virtual_ip_payload: Request to add a member to a virtual IP. (required) - :type add_member_to_virtual_ip_payload: AddMemberToVirtualIPPayload + :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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param add_routes_to_routing_table_payload: Request an addition of routes to a routing table. (required) + :type add_routes_to_routing_table_payload: AddRoutesToRoutingTablePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -410,13 +333,14 @@ def add_member_to_virtual_ip_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_member_to_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - virtual_ip_id=virtual_ip_id, - add_member_to_virtual_ip_payload=add_member_to_virtual_ip_payload, + _param = self._add_routes_to_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + add_routes_to_routing_table_payload=add_routes_to_routing_table_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -424,22 +348,24 @@ def add_member_to_virtual_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "VirtualIp", + "201": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _add_member_to_virtual_ip_serialize( + def _add_routes_to_routing_table_serialize( self, - project_id, - network_id, - virtual_ip_id, - add_member_to_virtual_ip_payload, + organization_id, + area_id, + region, + routing_table_id, + add_routes_to_routing_table_payload, _request_auth, _content_type, _headers, @@ -454,22 +380,24 @@ def _add_member_to_virtual_ip_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - if virtual_ip_id is not None: - _path_params["virtualIpId"] = virtual_ip_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if region is not None: + _path_params["region"] = region + if routing_table_id is not None: + _path_params["routingTableId"] = routing_table_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if add_member_to_virtual_ip_payload is not None: - _body_params = add_member_to_virtual_ip_payload + if add_routes_to_routing_table_payload is not None: + _body_params = add_routes_to_routing_table_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -487,8 +415,8 @@ def _add_member_to_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}/add-member", + method="POST", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -502,19 +430,23 @@ def _add_member_to_virtual_ip_serialize( ) @validate_call - def add_network_to_server( + def add_routing_table_to_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." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + add_routing_table_to_area_payload: Annotated[ + AddRoutingTableToAreaPayload, Field(description="Request an addition of a routing table to an area.") ], _request_timeout: Union[ None, @@ -525,17 +457,19 @@ def add_network_to_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Create and attach a network interface from the specified network. + ) -> RoutingTable: + """Create new routing table in a network area. - Create and attach a network interface from the specified network to the server. + Create a new routing table in an existing network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_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 region: The STACKIT Region of the resources. (required) + :type region: str + :param add_routing_table_to_area_payload: Request an addition of a routing table to an area. (required) + :type add_routing_table_to_area_payload: AddRoutingTableToAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -556,12 +490,13 @@ def add_network_to_server( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_network_to_server_serialize( - project_id=project_id, - server_id=server_id, - network_id=network_id, + _param = self._add_routing_table_to_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + add_routing_table_to_area_payload=add_routing_table_to_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -569,11 +504,12 @@ def add_network_to_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "RoutingTable", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -584,19 +520,23 @@ def add_network_to_server( ).data @validate_call - def add_network_to_server_with_http_info( + def add_routing_table_to_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." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + add_routing_table_to_area_payload: Annotated[ + AddRoutingTableToAreaPayload, Field(description="Request an addition of a routing table to an area.") ], _request_timeout: Union[ None, @@ -607,17 +547,19 @@ def add_network_to_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]: - """Create and attach a network interface from the specified network. + ) -> ApiResponse[RoutingTable]: + """Create new routing table in a network area. - Create and attach a network interface from the specified network to the server. + Create a new routing table in an existing network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_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 region: The STACKIT Region of the resources. (required) + :type region: str + :param add_routing_table_to_area_payload: Request an addition of a routing table to an area. (required) + :type add_routing_table_to_area_payload: AddRoutingTableToAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -638,12 +580,13 @@ def add_network_to_server_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_network_to_server_serialize( - project_id=project_id, - server_id=server_id, - network_id=network_id, + _param = self._add_routing_table_to_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + add_routing_table_to_area_payload=add_routing_table_to_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -651,11 +594,12 @@ def add_network_to_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "RoutingTable", "400": "Error", "401": "Error", "403": "Error", "404": "Error", + "409": "Error", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -666,19 +610,23 @@ def add_network_to_server_with_http_info( ) @validate_call - def add_network_to_server_without_preload_content( + def add_routing_table_to_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." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + add_routing_table_to_area_payload: Annotated[ + AddRoutingTableToAreaPayload, Field(description="Request an addition of a routing table to an area.") ], _request_timeout: Union[ None, @@ -690,16 +638,18 @@ def add_network_to_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create and attach a network interface from the specified network. + """Create new routing table in a network area. - Create and attach a network interface from the specified network to the server. + Create a new routing table in an existing network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_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 region: The STACKIT Region of the resources. (required) + :type region: str + :param add_routing_table_to_area_payload: Request an addition of a routing table to an area. (required) + :type add_routing_table_to_area_payload: AddRoutingTableToAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -720,12 +670,13 @@ def add_network_to_server_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_network_to_server_serialize( - project_id=project_id, - server_id=server_id, - network_id=network_id, + _param = self._add_routing_table_to_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + add_routing_table_to_area_payload=add_routing_table_to_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -733,21 +684,23 @@ def add_network_to_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "201": "RoutingTable", "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 _add_network_to_server_serialize( + def _add_routing_table_to_area_serialize( self, - project_id, - server_id, - network_id, + organization_id, + area_id, + region, + add_routing_table_to_area_payload, _request_auth, _content_type, _headers, @@ -762,31 +715,41 @@ def _add_network_to_server_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_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 + if region is not None: + _path_params["region"] = region # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if add_routing_table_to_area_payload is not None: + _body_params = add_routing_table_to_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="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -800,20 +763,14 @@ def _add_network_to_server_serialize( ) @validate_call - def add_nic_to_server( + 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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -823,17 +780,17 @@ def add_nic_to_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Attach an existing network interface. + ) -> Network: + """Create new network. - Attach an existing network interface to a server. + 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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param create_network_payload: Request a network creation. (required) + :type create_network_payload: CreateNetworkPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -854,12 +811,12 @@ def add_nic_to_server( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_nic_to_server_serialize( + _param = self._create_network_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + region=region, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -867,7 +824,7 @@ def add_nic_to_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "202": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -883,20 +840,14 @@ def add_nic_to_server( ).data @validate_call - def add_nic_to_server_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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -906,17 +857,17 @@ def add_nic_to_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]: - """Attach an existing network interface. + ) -> ApiResponse[Network]: + """Create new network. - Attach an existing network interface to a server. + 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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param create_network_payload: Request a network creation. (required) + :type create_network_payload: CreateNetworkPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -937,12 +888,12 @@ def add_nic_to_server_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_nic_to_server_serialize( + _param = self._create_network_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + region=region, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -950,7 +901,7 @@ def add_nic_to_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "202": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -966,20 +917,14 @@ def add_nic_to_server_with_http_info( ) @validate_call - def add_nic_to_server_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."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + create_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -990,16 +935,16 @@ def add_nic_to_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Attach an existing network interface. + """Create new network. - Attach an existing network interface to a server. + 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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param create_network_payload: Request a network creation. (required) + :type create_network_payload: CreateNetworkPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1020,12 +965,12 @@ def add_nic_to_server_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_nic_to_server_serialize( + _param = self._create_network_serialize( project_id=project_id, - server_id=server_id, - nic_id=nic_id, + region=region, + create_network_payload=create_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1033,7 +978,7 @@ def add_nic_to_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "202": "Network", "400": "Error", "401": "Error", "403": "Error", @@ -1044,11 +989,11 @@ def add_nic_to_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _add_nic_to_server_serialize( + def _create_network_serialize( self, project_id, - server_id, - nic_id, + region, + create_network_payload, _request_auth, _content_type, _headers, @@ -1063,31 +1008,39 @@ def _add_nic_to_server_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if nic_id is not None: - _path_params["nicId"] = nic_id + if region is not None: + _path_params["region"] = region # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_network_payload is not None: + _body_params = create_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="PUT", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}", + method="POST", + resource_path="/v2alpha1/projects/{projectId}/regions/{region}/networks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1101,18 +1054,16 @@ def _add_nic_to_server_serialize( ) @validate_call - def add_public_ip_to_server( + def delete_network( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], _request_timeout: Union[ None, @@ -1124,16 +1075,16 @@ def add_public_ip_to_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Associate a public IP to the server. + """Delete network. - Associate a public IP to a server. + Delete a network. If the network is still in use, the deletion will fail. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -1154,12 +1105,12 @@ def add_public_ip_to_server( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_public_ip_to_server_serialize( + _param = self._delete_network_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + region=region, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1183,18 +1134,16 @@ def add_public_ip_to_server( ).data @validate_call - def add_public_ip_to_server_with_http_info( + def delete_network_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], _request_timeout: Union[ None, @@ -1206,16 +1155,16 @@ def add_public_ip_to_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Associate a public IP to the server. + """Delete network. - Associate a public IP to a server. + Delete a network. If the network is still in use, the deletion will fail. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -1236,12 +1185,12 @@ def add_public_ip_to_server_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_public_ip_to_server_serialize( + _param = self._delete_network_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + region=region, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1265,18 +1214,16 @@ def add_public_ip_to_server_with_http_info( ) @validate_call - def add_public_ip_to_server_without_preload_content( + def delete_network_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], _request_timeout: Union[ None, @@ -1288,16 +1235,16 @@ def add_public_ip_to_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Associate a public IP to the server. + """Delete network. - Associate a public IP to a server. + Delete a network. If the network is still in use, the deletion will fail. :param project_id: The identifier (ID) of a STACKIT Project. (required) :type project_id: str - :param 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -1318,12 +1265,12 @@ def add_public_ip_to_server_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_public_ip_to_server_serialize( + _param = self._delete_network_serialize( project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, + region=region, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1342,11 +1289,11 @@ def add_public_ip_to_server_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _add_public_ip_to_server_serialize( + def _delete_network_serialize( self, project_id, - server_id, - public_ip_id, + region, + network_id, _request_auth, _content_type, _headers, @@ -1361,16 +1308,16 @@ def _add_public_ip_to_server_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if public_ip_id is not None: - _path_params["publicIpId"] = public_ip_id + if region is not None: + _path_params["region"] = region + if network_id is not None: + _path_params["networkId"] = network_id # process the query parameters # process the header parameters # process the form parameters @@ -1384,8 +1331,8 @@ def _add_public_ip_to_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}", + method="DELETE", + resource_path="/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1399,25 +1346,30 @@ def _add_public_ip_to_server_serialize( ) @validate_call - def add_security_group_to_server( + def delete_route_from_routing_table( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - security_group_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." ), ], + 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)], @@ -1428,16 +1380,20 @@ def add_security_group_to_server( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Add a server to a security group. + """Delete a route in a routing table. - Add an existing server to an existing security group. + Delete a route in an existing routing table. - :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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -1458,12 +1414,14 @@ def add_security_group_to_server( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_security_group_to_server_serialize( - project_id=project_id, - server_id=server_id, - security_group_id=security_group_id, + _param = self._delete_route_from_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1471,12 +1429,11 @@ def add_security_group_to_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "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) @@ -1487,25 +1444,30 @@ def add_security_group_to_server( ).data @validate_call - def add_security_group_to_server_with_http_info( + def delete_route_from_routing_table_with_http_info( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - security_group_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." ), ], + 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)], @@ -1516,16 +1478,20 @@ def add_security_group_to_server_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Add a server to a security group. + """Delete a route in a routing table. - Add an existing server to an existing security group. + Delete a route in an existing routing table. - :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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -1546,12 +1512,14 @@ def add_security_group_to_server_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_security_group_to_server_serialize( - project_id=project_id, - server_id=server_id, - security_group_id=security_group_id, + _param = self._delete_route_from_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1559,12 +1527,11 @@ def add_security_group_to_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "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) @@ -1575,25 +1542,30 @@ def add_security_group_to_server_with_http_info( ) @validate_call - def add_security_group_to_server_without_preload_content( + def delete_route_from_routing_table_without_preload_content( self, - project_id: Annotated[ + organization_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - security_group_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." ), ], + 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)], @@ -1604,16 +1576,20 @@ def add_security_group_to_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Add a server to a security group. + """Delete a route in a routing table. - Add an existing server to an existing security group. + Delete a route in an existing routing table. - :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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -1634,12 +1610,14 @@ def add_security_group_to_server_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_security_group_to_server_serialize( - project_id=project_id, - server_id=server_id, - security_group_id=security_group_id, + _param = self._delete_route_from_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1647,22 +1625,23 @@ def add_security_group_to_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "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 _add_security_group_to_server_serialize( + def _delete_route_from_routing_table_serialize( self, - project_id, - server_id, - security_group_id, + organization_id, + area_id, + region, + routing_table_id, + route_id, _request_auth, _content_type, _headers, @@ -1677,16 +1656,20 @@ def _add_security_group_to_server_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if region is not None: + _path_params["region"] = region + if routing_table_id is not None: + _path_params["routingTableId"] = routing_table_id + if route_id is not None: + _path_params["routeId"] = route_id # process the query parameters # process the header parameters # process the form parameters @@ -1700,8 +1683,8 @@ def _add_security_group_to_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}", + method="DELETE", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1715,18 +1698,26 @@ def _add_security_group_to_server_serialize( ) @validate_call - def add_service_account_to_server( + def delete_routing_table_from_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." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - service_account_mail: Annotated[ - str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], _request_timeout: Union[ None, @@ -1737,17 +1728,19 @@ def add_service_account_to_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServiceAccountMailListResponse: - """Attach service account to a server. + ) -> None: + """Delete a routing table. - Attach an additional service account to the server. + Delete a routing table of a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param service_account_mail: The e-mail address of a service account. (required) - :type service_account_mail: 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1768,12 +1761,13 @@ def add_service_account_to_server( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_service_account_to_server_serialize( - project_id=project_id, - server_id=server_id, - service_account_mail=service_account_mail, + _param = self._delete_routing_table_from_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1781,12 +1775,11 @@ def add_service_account_to_server( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ServiceAccountMailListResponse", + "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) @@ -1797,18 +1790,26 @@ def add_service_account_to_server( ).data @validate_call - def add_service_account_to_server_with_http_info( + def delete_routing_table_from_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." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - service_account_mail: Annotated[ - str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], _request_timeout: Union[ None, @@ -1819,17 +1820,19 @@ def add_service_account_to_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]: - """Attach service account to a server. + ) -> ApiResponse[None]: + """Delete a routing table. - Attach an additional service account to the server. + Delete a routing table of a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param service_account_mail: The e-mail address of a service account. (required) - :type service_account_mail: 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1850,12 +1853,13 @@ def add_service_account_to_server_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_service_account_to_server_serialize( - project_id=project_id, - server_id=server_id, - service_account_mail=service_account_mail, + _param = self._delete_routing_table_from_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1863,12 +1867,11 @@ def add_service_account_to_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ServiceAccountMailListResponse", + "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) @@ -1879,18 +1882,26 @@ def add_service_account_to_server_with_http_info( ) @validate_call - def add_service_account_to_server_without_preload_content( + def delete_routing_table_from_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." + ), ], - server_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - service_account_mail: Annotated[ - str, Field(strict=True, max_length=255, description="The e-mail address of a service account.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], _request_timeout: Union[ None, @@ -1902,16 +1913,18 @@ def add_service_account_to_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Attach service account to a server. + """Delete a routing table. - Attach an additional service account to the server. + Delete a routing table of a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param service_account_mail: The e-mail address of a service account. (required) - :type service_account_mail: 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1932,12 +1945,13 @@ def add_service_account_to_server_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_service_account_to_server_serialize( - project_id=project_id, - server_id=server_id, - service_account_mail=service_account_mail, + _param = self._delete_routing_table_from_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1945,22 +1959,22 @@ def add_service_account_to_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ServiceAccountMailListResponse", + "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 _add_service_account_to_server_serialize( + def _delete_routing_table_from_area_serialize( self, - project_id, - server_id, - service_account_mail, + organization_id, + area_id, + region, + routing_table_id, _request_auth, _content_type, _headers, @@ -1975,16 +1989,18 @@ def _add_service_account_to_server_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if service_account_mail is not None: - _path_params["serviceAccountMail"] = service_account_mail + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if region is not None: + _path_params["region"] = region + if routing_table_id is not None: + _path_params["routingTableId"] = routing_table_id # process the query parameters # process the header parameters # process the form parameters @@ -1998,8 +2014,8 @@ def _add_service_account_to_server_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}", + method="DELETE", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2013,23 +2029,17 @@ def _add_service_account_to_server_serialize( ) @validate_call - def add_volume_to_server( + def get_network( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - volume_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - add_volume_to_server_payload: Annotated[ - Optional[AddVolumeToServerPayload], Field(description="Request a volume attachment creation.") - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2039,19 +2049,17 @@ def add_volume_to_server( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeAttachment: - """Attach a volume to a server. + ) -> Network: + """Get network details. - Attach an existing volume to an existing server. + Get details about a network of 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param add_volume_to_server_payload: Request a volume attachment creation. - :type add_volume_to_server_payload: AddVolumeToServerPayload + :param region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -2072,13 +2080,12 @@ def add_volume_to_server( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_volume_to_server_serialize( + _param = self._get_network_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, - add_volume_to_server_payload=add_volume_to_server_payload, + region=region, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2086,12 +2093,11 @@ def add_volume_to_server( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "VolumeAttachment", + "200": "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) @@ -2102,23 +2108,17 @@ def add_volume_to_server( ).data @validate_call - def add_volume_to_server_with_http_info( + def get_network_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + 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."), ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - add_volume_to_server_payload: Annotated[ - Optional[AddVolumeToServerPayload], Field(description="Request a volume attachment creation.") - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2128,19 +2128,17 @@ def add_volume_to_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[VolumeAttachment]: - """Attach a volume to a server. + ) -> ApiResponse[Network]: + """Get network details. - Attach an existing volume to an existing server. + Get details about a network of 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param add_volume_to_server_payload: Request a volume attachment creation. - :type add_volume_to_server_payload: AddVolumeToServerPayload + :param region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -2161,13 +2159,12 @@ def add_volume_to_server_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_volume_to_server_serialize( + _param = self._get_network_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, - add_volume_to_server_payload=add_volume_to_server_payload, + region=region, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2175,12 +2172,11 @@ def add_volume_to_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "VolumeAttachment", + "200": "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) @@ -2191,23 +2187,17 @@ def add_volume_to_server_with_http_info( ) @validate_call - def add_volume_to_server_without_preload_content( + def get_network_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - volume_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + network_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), + Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), ], - add_volume_to_server_payload: Annotated[ - Optional[AddVolumeToServerPayload], Field(description="Request a volume attachment creation.") - ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2218,18 +2208,16 @@ def add_volume_to_server_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Attach a volume to a server. + """Get network details. - Attach an existing volume to an existing server. + Get details about a network of 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 volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param add_volume_to_server_payload: Request a volume attachment creation. - :type add_volume_to_server_payload: AddVolumeToServerPayload + :param region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -2250,13 +2238,12 @@ def add_volume_to_server_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._add_volume_to_server_serialize( + _param = self._get_network_serialize( project_id=project_id, - server_id=server_id, - volume_id=volume_id, - add_volume_to_server_payload=add_volume_to_server_payload, + region=region, + network_id=network_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2264,23 +2251,21 @@ def add_volume_to_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "VolumeAttachment", + "200": "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 _add_volume_to_server_serialize( + def _get_network_serialize( self, project_id, - server_id, - volume_id, - add_volume_to_server_payload, + region, + network_id, _request_auth, _content_type, _headers, @@ -2295,41 +2280,31 @@ def _add_volume_to_server_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if volume_id is not None: - _path_params["volumeId"] = volume_id + if region is not None: + _path_params["region"] = region + 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 add_volume_to_server_payload is not None: - _body_params = add_volume_to_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="PUT", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", + method="GET", + resource_path="/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2343,14 +2318,29 @@ def _add_volume_to_server_serialize( ) @validate_call - def create_affinity_group( + def get_route_of_routing_table( 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." + ), + ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - create_affinity_group_payload: Annotated[ - CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + 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, @@ -2361,15 +2351,21 @@ def create_affinity_group( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AffinityGroup: - """Create a new affinity group in a project. + ) -> Route: + """Get details about a route of a routing table. - Create a new server affinity group in the given project ID. + Get details about a route defined in a routing table. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_affinity_group_payload: Request a affinity group creation. (required) - :type create_affinity_group_payload: CreateAffinityGroupPayload + :param 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -2390,11 +2386,14 @@ def create_affinity_group( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._create_affinity_group_serialize( - project_id=project_id, - create_affinity_group_payload=create_affinity_group_payload, + _param = self._get_route_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2402,7 +2401,7 @@ def create_affinity_group( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "AffinityGroup", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -2417,14 +2416,29 @@ def create_affinity_group( ).data @validate_call - def create_affinity_group_with_http_info( + def get_route_of_routing_table_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." + ), + ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - create_affinity_group_payload: Annotated[ - CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + 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, @@ -2435,15 +2449,21 @@ def create_affinity_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[AffinityGroup]: - """Create a new affinity group in a project. + ) -> ApiResponse[Route]: + """Get details about a route of a routing table. - Create a new server affinity group in the given project ID. + Get details about a route defined in a routing table. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_affinity_group_payload: Request a affinity group creation. (required) - :type create_affinity_group_payload: CreateAffinityGroupPayload + :param 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -2464,11 +2484,14 @@ def create_affinity_group_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._create_affinity_group_serialize( - project_id=project_id, - create_affinity_group_payload=create_affinity_group_payload, + _param = self._get_route_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2476,7 +2499,7 @@ def create_affinity_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "AffinityGroup", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -2491,14 +2514,29 @@ def create_affinity_group_with_http_info( ) @validate_call - def create_affinity_group_without_preload_content( + def get_route_of_routing_table_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." + ), + ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - create_affinity_group_payload: Annotated[ - CreateAffinityGroupPayload, Field(description="Request a affinity group creation.") + 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, @@ -2510,14 +2548,20 @@ def create_affinity_group_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create a new affinity group in a project. + """Get details about a route of a routing table. - Create a new server affinity group in the given project ID. + Get details about a route defined in a routing table. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_affinity_group_payload: Request a affinity group creation. (required) - :type create_affinity_group_payload: CreateAffinityGroupPayload + :param 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -2538,11 +2582,14 @@ def create_affinity_group_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._create_affinity_group_serialize( - project_id=project_id, - create_affinity_group_payload=create_affinity_group_payload, + _param = self._get_route_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2550,7 +2597,7 @@ def create_affinity_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "AffinityGroup", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -2560,10 +2607,13 @@ def create_affinity_group_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_affinity_group_serialize( + def _get_route_of_routing_table_serialize( self, - project_id, - create_affinity_group_payload, + organization_id, + area_id, + region, + routing_table_id, + route_id, _request_auth, _content_type, _headers, @@ -2578,37 +2628,35 @@ def _create_affinity_group_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if region is not None: + _path_params["region"] = region + if routing_table_id is not None: + _path_params["routingTableId"] = routing_table_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 create_affinity_group_payload is not None: - _body_params = create_affinity_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="POST", - resource_path="/v1alpha1/projects/{projectId}/affinity-groups", + method="GET", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2622,85 +2670,27 @@ def _create_affinity_group_serialize( ) @validate_call - def create_backup( + def get_routing_table_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." + ), ], - create_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup 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, - ) -> Backup: - """Create new Backup. - - Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_backup_serialize( - project_id=project_id, - create_backup_payload=create_backup_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_backup_with_http_info( - self, - project_id: Annotated[ + area_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 Network Area." + ), + ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - create_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup creation.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2710,32056 +2700,19 @@ def create_backup_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[Backup]: - """Create new Backup. - - Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. + ) -> RoutingTable: + """Get details about a routing table. - :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 - (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 + Get details about a routing table defined in a network area. - _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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_backup_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_backup_payload: Annotated[CreateBackupPayload, Field(description="Request a backup creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new Backup. - - Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_backup_serialize( - project_id=project_id, - create_backup_payload=create_backup_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _create_backup_serialize( - self, - project_id, - create_backup_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_backup_payload is not None: - _body_params = create_backup_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}/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 create_image( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageCreateResponse: - """Create new Image. - - Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_image_payload: Request an image creation. (required) - :type create_image_payload: CreateImagePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_image_serialize( - project_id=project_id, - create_image_payload=create_image_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "ImageCreateResponse", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "429": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_image_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ImageCreateResponse]: - """Create new Image. - - Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_image_payload: Request an image creation. (required) - :type create_image_payload: CreateImagePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_image_serialize( - project_id=project_id, - create_image_payload=create_image_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "ImageCreateResponse", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "429": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_image_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_image_payload: Annotated[CreateImagePayload, Field(description="Request an image creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new Image. - - Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_image_payload: Request an image creation. (required) - :type create_image_payload: CreateImagePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_image_serialize( - project_id=project_id, - create_image_payload=create_image_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "ImageCreateResponse", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "429": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _create_image_serialize( - self, - project_id, - create_image_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_image_payload is not None: - _body_params = create_image_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/images", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def create_key_pair( - self, - create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Keypair: - """Import a public key. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_key_pair_serialize( - create_key_pair_payload=create_key_pair_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", - "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 create_key_pair_with_http_info( - self, - create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Keypair]: - """Import a public key. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_key_pair_serialize( - create_key_pair_payload=create_key_pair_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", - "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 create_key_pair_without_preload_content( - self, - create_key_pair_payload: Annotated[CreateKeyPairPayload, Field(description="Request a public key import.")], - _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: - """Import a public key. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_key_pair_serialize( - create_key_pair_payload=create_key_pair_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Keypair", - "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( - self, - create_key_pair_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # 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 - - # 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/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 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_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network 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, - ) -> Network: - """Create new network. - - 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_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_network_serialize( - project_id=project_id, - create_network_payload=create_network_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - 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_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network 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[Network]: - """Create new network. - - 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_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_network_serialize( - project_id=project_id, - create_network_payload=create_network_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - 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_network_payload: Annotated[CreateNetworkPayload, Field(description="Request a network creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new network. - - 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_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_network_serialize( - project_id=project_id, - create_network_payload=create_network_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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_network_serialize( - self, - project_id, - create_network_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_network_payload is not None: - _body_params = create_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="POST", - 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 create_network_area( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - create_network_area_payload: Annotated[ - CreateNetworkAreaPayload, Field(description="Request an Area creation.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkArea: - """Create new network area in an organization. - - Create a new network area in an organization. - - :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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_network_area_with_http_info( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - create_network_area_payload: Annotated[ - CreateNetworkAreaPayload, Field(description="Request an Area 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[NetworkArea]: - """Create new network area in an organization. - - Create a new network area in an organization. - - :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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_network_area_without_preload_content( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - create_network_area_payload: Annotated[ - CreateNetworkAreaPayload, Field(description="Request an Area creation.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new network area in an organization. - - Create a new network area in an organization. - - :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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _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 _create_network_area_serialize( - self, - organization_id, - create_network_area_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if 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_network_area_payload is not None: - _body_params = create_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="POST", - 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 create_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." - ), - ], - create_network_area_range_payload: Annotated[ - CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an 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: - """Create new network range in a network area. - - Create a new network range in an existing 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_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." - ), - ], - create_network_area_range_payload: Annotated[ - CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an 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]: - """Create new network range in a network area. - - Create a new network range in an existing 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_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." - ), - ], - create_network_area_range_payload: Annotated[ - CreateNetworkAreaRangePayload, Field(description="Request an addition of network ranges to an 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: - """Create new network range in a network area. - - Create a new network range in an existing 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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_network_area_range_serialize( - self, - organization_id, - area_id, - create_network_area_range_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_network_area_range_payload is not None: - _body_params = create_network_area_range_payload - - # 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/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 create_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." - ), - ], - create_network_area_route_payload: Annotated[ - CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an 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, - ) -> RouteListResponse: - """Create new network routes. - - Create one or several new network routes 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "RouteListResponse", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_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." - ), - ], - create_network_area_route_payload: Annotated[ - CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an 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[RouteListResponse]: - """Create new network routes. - - Create one or several new network routes 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "RouteListResponse", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_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." - ), - ], - create_network_area_route_payload: Annotated[ - CreateNetworkAreaRoutePayload, Field(description="Request an addition of routes to an 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: - """Create new network routes. - - Create one or several new network routes 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "RouteListResponse", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _create_network_area_route_serialize( - self, - organization_id, - area_id, - create_network_area_route_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_network_area_route_payload is not None: - _body_params = create_network_area_route_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/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 create_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."), - ], - create_nic_payload: Annotated[CreateNicPayload, Field(description="Request a network interface 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, - ) -> NIC: - """Create new network interface. - - Create a new network interface in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_nic_serialize( - project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - 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."), - ], - 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)], - 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]: - """Create new network interface. - - Create a new network interface in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_nic_serialize( - project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - 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."), - ], - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new network interface. - - Create a new network interface in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_nic_serialize( - project_id=project_id, - network_id=network_id, - create_nic_payload=create_nic_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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_nic_serialize( - self, - project_id, - network_id, - create_nic_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if 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 - - # 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}/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 create_public_ip( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP 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, - ) -> PublicIp: - """Create new public IP. - - Create a new public IP in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_public_ip_serialize( - project_id=project_id, - create_public_ip_payload=create_public_ip_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "429": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_public_ip_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP 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[PublicIp]: - """Create new public IP. - - Create a new public IP in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_public_ip_serialize( - project_id=project_id, - create_public_ip_payload=create_public_ip_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "429": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_public_ip_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_public_ip_payload: Annotated[CreatePublicIPPayload, Field(description="Request a public IP creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new public IP. - - Create a new public IP in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_public_ip_serialize( - project_id=project_id, - create_public_ip_payload=create_public_ip_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "PublicIp", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "429": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _create_public_ip_serialize( - self, - project_id, - create_public_ip_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_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}/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 create_security_group( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group 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, - ) -> SecurityGroup: - """Create new security group. - - Create a new security group in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_security_group_serialize( - project_id=project_id, - create_security_group_payload=create_security_group_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 create_security_group_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group 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[SecurityGroup]: - """Create new security group. - - Create a new security group in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_security_group_serialize( - project_id=project_id, - create_security_group_payload=create_security_group_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 create_security_group_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_security_group_payload: Annotated[ - CreateSecurityGroupPayload, Field(description="Request a security group creation.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new security group. - - Create a new security group in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_security_group_serialize( - project_id=project_id, - create_security_group_payload=create_security_group_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 _create_security_group_serialize( - self, - project_id, - create_security_group_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_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="POST", - 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 create_security_group_rule( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - 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, - ) -> SecurityGroupRule: - """Create new security group rule. - - Create a new security group rule in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 create_security_group_rule_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - 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[SecurityGroupRule]: - """Create new security group rule. - - Create a new security group rule in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 create_security_group_rule_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - 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, - ) -> RESTResponseType: - """Create new security group rule. - - Create a new security group rule in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 _create_security_group_rule_serialize( - self, - project_id, - security_group_id, - create_security_group_rule_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_security_group_rule_payload is not None: - _body_params = create_security_group_rule_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/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 create_server( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], - _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: - """Create new server. - - Create a new server in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_server_serialize( - project_id=project_id, - create_server_payload=create_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 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."), - ], - create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server 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[Server]: - """Create new server. - - Create a new server in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_server_serialize( - project_id=project_id, - create_server_payload=create_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 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."), - ], - create_server_payload: Annotated[CreateServerPayload, Field(description="Request a server creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new server. - - Create a new server in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_server_payload: Request a server creation. (required) - :type create_server_payload: CreateServerPayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_server_serialize( - project_id=project_id, - create_server_payload=create_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 _create_server_serialize( - self, - project_id, - create_server_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_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="POST", - 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 create_snapshot( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot 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, - ) -> Snapshot: - """Create new Snapshot. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_snapshot_serialize( - project_id=project_id, - create_snapshot_payload=create_snapshot_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 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."), - ], - create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot 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[Snapshot]: - """Create new Snapshot. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_snapshot_serialize( - project_id=project_id, - create_snapshot_payload=create_snapshot_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 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."), - ], - create_snapshot_payload: Annotated[CreateSnapshotPayload, Field(description="Request a snapshot creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new Snapshot. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_snapshot_serialize( - project_id=project_id, - create_snapshot_payload=create_snapshot_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "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 _create_snapshot_serialize( - self, - project_id, - create_snapshot_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - # 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="POST", - 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 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."), - ], - network_id: Annotated[ - str, - 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, - 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: - """Create new virtual IP. - - Create a new virtual IP in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - create_virtual_ip_payload=create_virtual_ip_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "VirtualIp", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "429": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_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."), - ], - create_virtual_ip_payload: Annotated[ - CreateVirtualIPPayload, Field(description="Request a virtual IP 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[VirtualIp]: - """Create new virtual IP. - - Create a new virtual IP in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - create_virtual_ip_payload=create_virtual_ip_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "VirtualIp", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "429": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_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."), - ], - create_virtual_ip_payload: Annotated[ - CreateVirtualIPPayload, Field(description="Request a virtual IP creation.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new virtual IP. - - Create a new virtual IP in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param create_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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_virtual_ip_serialize( - project_id=project_id, - network_id=network_id, - create_virtual_ip_payload=create_virtual_ip_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "VirtualIp", - "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_virtual_ip_serialize( - self, - project_id, - network_id, - create_virtual_ip_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if 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="POST", - 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 create_volume( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Volume: - """Create new volume. - - Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_volume_payload: Request a volume creation. (required) - :type create_volume_payload: CreateVolumePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_volume_serialize( - project_id=project_id, - create_volume_payload=create_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - 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."), - ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Volume]: - """Create new volume. - - Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_volume_payload: Request a volume creation. (required) - :type create_volume_payload: CreateVolumePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_volume_serialize( - project_id=project_id, - create_volume_payload=create_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_volume_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - create_volume_payload: Annotated[CreateVolumePayload, Field(description="Request a volume creation.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create new volume. - - Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param create_volume_payload: Request a volume creation. (required) - :type create_volume_payload: CreateVolumePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._create_volume_serialize( - project_id=project_id, - create_volume_payload=create_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Volume", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _create_volume_serialize( - self, - project_id, - create_volume_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_volume_payload is not None: - _body_params = create_volume_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/volumes", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def deallocate_server( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Deallocate an existing server. - - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._deallocate_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def deallocate_server_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Deallocate an existing server. - - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._deallocate_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def deallocate_server_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Deallocate an existing server. - - Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._deallocate_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _deallocate_server_serialize( - self, - project_id, - server_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def delete_affinity_group( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - affinity_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Affinity Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a affinity group in a project. - - Delete a affinity group in the given project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) - :type affinity_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_affinity_group_serialize( - project_id=project_id, - affinity_group_id=affinity_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_affinity_group_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - affinity_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Affinity Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a affinity group in a project. - - Delete a affinity group in the given project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) - :type affinity_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_affinity_group_serialize( - project_id=project_id, - affinity_group_id=affinity_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_affinity_group_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - affinity_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Affinity Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a affinity group in a project. - - Delete a affinity group in the given project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) - :type affinity_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_affinity_group_serialize( - project_id=project_id, - affinity_group_id=affinity_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_affinity_group_serialize( - self, - project_id, - affinity_group_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if affinity_group_id is not None: - _path_params["affinityGroupId"] = affinity_group_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def delete_backup( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - force: Annotated[Optional[StrictBool], Field(description="Force action.")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a backup. - - Delete a backup that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param force: Force action. - :type force: bool - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_backup_serialize( - project_id=project_id, - backup_id=backup_id, - force=force, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_backup_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - force: Annotated[Optional[StrictBool], Field(description="Force action.")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a backup. - - Delete a backup that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param force: Force action. - :type force: bool - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_backup_serialize( - project_id=project_id, - backup_id=backup_id, - force=force, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_backup_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - force: Annotated[Optional[StrictBool], Field(description="Force action.")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a backup. - - Delete a backup that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param force: Force action. - :type force: bool - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_backup_serialize( - project_id=project_id, - backup_id=backup_id, - force=force, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_backup_serialize( - self, - project_id, - backup_id, - force, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if backup_id is not None: - _path_params["backupId"] = backup_id - # process the query parameters - if force is not None: - - _query_params.append(("force", force)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/backups/{backupId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def delete_image( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete an Image. - - Delete an image that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_image_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete an Image. - - Delete an image that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_image_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete an Image. - - Delete an image that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_image_serialize( - self, - project_id, - image_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def delete_image_share( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Remove image share. - - Remove the image share. New scope will be local. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_share_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_image_share_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Remove image share. - - Remove the image share. New scope will be local. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_share_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_image_share_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Remove image share. - - Remove the image share. New scope will be local. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_share_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_image_share_serialize( - self, - project_id, - image_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def delete_image_share_consumer( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - consumer_project_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Project that consumes an image share.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Remove an image share consumer. - - Remove consumer from a shared image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) - :type consumer_project_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_share_consumer_serialize( - project_id=project_id, - image_id=image_id, - consumer_project_id=consumer_project_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_image_share_consumer_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - consumer_project_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Project that consumes an image share.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Remove an image share consumer. - - Remove consumer from a shared image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) - :type consumer_project_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_share_consumer_serialize( - project_id=project_id, - image_id=image_id, - consumer_project_id=consumer_project_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_image_share_consumer_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - consumer_project_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Project that consumes an image share.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Remove an image share consumer. - - Remove consumer from a shared image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) - :type consumer_project_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_image_share_consumer_serialize( - project_id=project_id, - image_id=image_id, - consumer_project_id=consumer_project_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_image_share_consumer_serialize( - self, - project_id, - image_id, - consumer_project_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - if consumer_project_id is not None: - _path_params["consumerProjectId"] = consumer_project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def delete_key_pair( - self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete an SSH keypair. - - Delete an SSH keypair from a user. - - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_key_pair_serialize( - keypair_name=keypair_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_key_pair_with_http_info( - self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete an SSH keypair. - - Delete an SSH keypair from a user. - - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_key_pair_serialize( - keypair_name=keypair_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_key_pair_without_preload_content( - self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete an SSH keypair. - - Delete an SSH keypair from a user. - - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_key_pair_serialize( - keypair_name=keypair_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_key_pair_serialize( - self, - keypair_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if keypair_name is not None: - _path_params["keypairName"] = keypair_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/keypairs/{keypairName}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def delete_network( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete network. - - Delete a network. If the network is still in use, the deletion will fail. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_serialize( - project_id=project_id, - network_id=network_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_network_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete network. - - Delete a network. If the network is still in use, the deletion will fail. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_serialize( - project_id=project_id, - network_id=network_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_network_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete network. - - Delete a network. If the network is still in use, the deletion will fail. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_serialize( - project_id=project_id, - network_id=network_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_network_serialize( - self, - project_id, - network_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def delete_network_area( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a network area. - - Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_network_area_with_http_info( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a network area. - - Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_network_area_without_preload_content( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a network area. - - Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_network_area_serialize( - self, - organization_id, - area_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 delete_network_area_range( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - network_range_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a network range. - - Delete a network range of a network area. The deletion will fail if the network range is still used. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_network_area_range_with_http_info( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - network_range_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a network range. - - Delete a network range of a network area. The deletion will fail if the network range is still used. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_network_area_range_without_preload_content( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - network_range_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Range." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a network range. - - Delete a network range of a network area. The deletion will fail if the network range is still used. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param network_range_id: The identifier (ID) of a STACKIT Network Range. (required) - :type network_range_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_range_serialize( - organization_id=organization_id, - area_id=area_id, - network_range_id=network_range_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_network_area_range_serialize( - self, - organization_id, - area_id, - network_range_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id - if network_range_id is not None: - _path_params["networkRangeId"] = network_range_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 delete_network_area_route( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a network route. - - Delete a network route of a network area. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_network_area_route_with_http_info( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a network route. - - Delete a network route of a network area. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_network_area_route_without_preload_content( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - route_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a network route. - - Delete a network route of a network area. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param route_id: The identifier (ID) of a STACKIT Route. (required) - :type route_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_network_area_route_serialize( - organization_id=organization_id, - area_id=area_id, - route_id=route_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_network_area_route_serialize( - self, - organization_id, - area_id, - route_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id - if route_id is not None: - _path_params["routeId"] = route_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 delete_nic( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a network interface. - - Delete a network interface that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_nic_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a network interface. - - Delete a network interface that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_nic_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a network interface. - - Delete a network interface that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param nic_id: The identifier (ID) of a network interface. (required) - :type nic_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_nic_serialize( - self, - project_id, - network_id, - nic_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - if nic_id is not None: - _path_params["nicId"] = nic_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 delete_public_ip( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a public IP. - - Delete a public IP that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_public_ip_serialize( - project_id=project_id, - public_ip_id=public_ip_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_public_ip_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a public IP. - - Delete a public IP that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_public_ip_serialize( - project_id=project_id, - public_ip_id=public_ip_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_public_ip_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a public IP. - - Delete a public IP that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param public_ip_id: The identifier (ID) of a Public IP. (required) - :type public_ip_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_public_ip_serialize( - project_id=project_id, - public_ip_id=public_ip_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_public_ip_serialize( - self, - project_id, - public_ip_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if public_ip_id is not None: - _path_params["publicIpId"] = public_ip_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 delete_security_group( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete security group. - - Delete a security group. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_security_group_serialize( - project_id=project_id, - security_group_id=security_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_security_group_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete security group. - - Delete a security group. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_security_group_serialize( - project_id=project_id, - security_group_id=security_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_security_group_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete security group. - - Delete a security group. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_security_group_serialize( - project_id=project_id, - security_group_id=security_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_security_group_serialize( - self, - project_id, - security_group_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 delete_security_group_rule( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - security_group_rule_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete security group rule. - - Delete a security group rule. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_security_group_rule_serialize( - project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_security_group_rule_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - security_group_rule_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete security group rule. - - Delete a security group rule. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_security_group_rule_serialize( - project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_security_group_rule_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - security_group_rule_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group Rule.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete security group rule. - - Delete a security group rule. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param security_group_id: The identifier (ID) of a STACKIT Security Group. (required) - :type security_group_id: str - :param security_group_rule_id: The identifier (ID) of a STACKIT Security Group Rule. (required) - :type security_group_rule_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_security_group_rule_serialize( - project_id=project_id, - security_group_id=security_group_id, - security_group_rule_id=security_group_rule_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_security_group_rule_serialize( - self, - project_id, - security_group_id, - security_group_rule_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id - if security_group_rule_id is not None: - _path_params["securityGroupRuleId"] = security_group_rule_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 delete_server( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a server. - - Delete a server. Volumes won't be deleted. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_server_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a server. - - Delete a server. Volumes won't be deleted. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_server_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a server. - - Delete a server. Volumes won't be deleted. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_server_serialize( - self, - project_id, - server_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 delete_snapshot( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - snapshot_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a snapshot. - - Delete a snapshot that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) - :type snapshot_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_snapshot_serialize( - project_id=project_id, - snapshot_id=snapshot_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_snapshot_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - snapshot_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a snapshot. - - Delete a snapshot that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) - :type snapshot_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_snapshot_serialize( - project_id=project_id, - snapshot_id=snapshot_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_snapshot_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - snapshot_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a snapshot. - - Delete a snapshot that is part of the project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) - :type snapshot_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_snapshot_serialize( - project_id=project_id, - snapshot_id=snapshot_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_snapshot_serialize( - self, - project_id, - snapshot_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if snapshot_id is not None: - _path_params["snapshotId"] = snapshot_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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 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."), - ], - 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, - ) -> None: - """Delete a virtual IP. - - 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 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._delete_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]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_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[None]: - """Delete a virtual IP. - - 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 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._delete_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]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_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: - """Delete a virtual IP. - - 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 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._delete_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]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_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="DELETE", - 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 delete_volume( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a volume. - - Delete a volume inside a project. The deletion will fail if the volume is still in use. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_volume_serialize( - project_id=project_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_volume_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a volume. - - Delete a volume inside a project. The deletion will fail if the volume is still in use. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_volume_serialize( - project_id=project_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_volume_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete a volume. - - Delete a volume inside a project. The deletion will fail if the volume is still in use. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._delete_volume_serialize( - project_id=project_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _delete_volume_serialize( - self, - project_id, - volume_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if volume_id is not None: - _path_params["volumeId"] = volume_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/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_affinity_group( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - affinity_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Affinity Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AffinityGroup: - """Get the affinity group. - - Get the affinity group created in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) - :type affinity_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_affinity_group_serialize( - project_id=project_id, - affinity_group_id=affinity_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AffinityGroup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_affinity_group_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - affinity_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Affinity Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AffinityGroup]: - """Get the affinity group. - - Get the affinity group created in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) - :type affinity_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_affinity_group_serialize( - project_id=project_id, - affinity_group_id=affinity_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AffinityGroup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_affinity_group_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - affinity_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Affinity Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the affinity group. - - Get the affinity group created in a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param affinity_group_id: The identifier (ID) of a STACKIT Affinity Group. (required) - :type affinity_group_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_affinity_group_serialize( - project_id=project_id, - affinity_group_id=affinity_group_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AffinityGroup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_affinity_group_serialize( - self, - project_id, - affinity_group_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if affinity_group_id is not None: - _path_params["affinityGroupId"] = affinity_group_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_attached_volume( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeAttachment: - """Get Volume Attachment details. - - Get the details of an existing Volume Attachment. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_attached_volume_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_attached_volume_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumeAttachment]: - """Get Volume Attachment details. - - Get the details of an existing Volume Attachment. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_attached_volume_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_attached_volume_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Volume Attachment details. - - Get the details of an existing Volume Attachment. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param volume_id: The identifier (ID) of a STACKIT Volume. (required) - :type volume_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_attached_volume_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_attached_volume_serialize( - self, - project_id, - server_id, - volume_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if volume_id is not None: - _path_params["volumeId"] = volume_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_backup( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Backup: - """Get details about a backup. - - Get details about a block device backup. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_backup_serialize( - project_id=project_id, - backup_id=backup_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_backup_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Backup]: - """Get details about a backup. - - Get details about a block device backup. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_backup_serialize( - project_id=project_id, - backup_id=backup_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_backup_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get details about a backup. - - Get details about a block device backup. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_backup_serialize( - project_id=project_id, - backup_id=backup_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_backup_serialize( - self, - project_id, - backup_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if backup_id is not None: - _path_params["backupId"] = backup_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/backups/{backupId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_image( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Image: - """Get details about an image. - - Get details about a specific Image inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_image_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Image]: - """Get details about an image. - - Get details about a specific Image inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_image_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get details about an image. - - Get details about a specific Image inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_image_serialize( - self, - project_id, - image_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_image_share( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageShare: - """Get share details of an image. - - Get share details about an shared image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_share_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_image_share_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ImageShare]: - """Get share details of an image. - - Get share details about an shared image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_share_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_image_share_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get share details of an image. - - Get share details about an shared image. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_share_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_image_share_serialize( - self, - project_id, - image_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_image_share_consumer( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - consumer_project_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Project that consumes an image share.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageShareConsumer: - """Get image share consumer. - - Get details about an image share consumer. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) - :type consumer_project_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_share_consumer_serialize( - project_id=project_id, - image_id=image_id, - consumer_project_id=consumer_project_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShareConsumer", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_image_share_consumer_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - consumer_project_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Project that consumes an image share.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ImageShareConsumer]: - """Get image share consumer. - - Get details about an image share consumer. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) - :type consumer_project_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_share_consumer_serialize( - project_id=project_id, - image_id=image_id, - consumer_project_id=consumer_project_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShareConsumer", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_image_share_consumer_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - consumer_project_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Project that consumes an image share.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get image share consumer. - - Get details about an image share consumer. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param consumer_project_id: The identifier (ID) of a STACKIT Project that consumes an image share. (required) - :type consumer_project_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_image_share_consumer_serialize( - project_id=project_id, - image_id=image_id, - consumer_project_id=consumer_project_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShareConsumer", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_image_share_consumer_serialize( - self, - project_id, - image_id, - consumer_project_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - if consumer_project_id is not None: - _path_params["consumerProjectId"] = consumer_project_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_key_pair( - self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Keypair: - """Get SSH keypair details. - - Get details about an SSH keypair. - - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_key_pair_serialize( - keypair_name=keypair_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_key_pair_with_http_info( - self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Keypair]: - """Get SSH keypair details. - - Get details about an SSH keypair. - - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_key_pair_serialize( - keypair_name=keypair_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_key_pair_without_preload_content( - self, - keypair_name: Annotated[str, Field(strict=True, max_length=127, description="The name of an SSH keypair.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get SSH keypair details. - - Get details about an SSH keypair. - - :param keypair_name: The name of an SSH keypair. (required) - :type keypair_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_key_pair_serialize( - keypair_name=keypair_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_key_pair_serialize( - self, - keypair_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if keypair_name is not None: - _path_params["keypairName"] = keypair_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/keypairs/{keypairName}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_machine_type( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> MachineType: - """Get details about a machine type. - - Get details about a specific machine type. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param machine_type: STACKIT machine type Name. (required) - :type machine_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_machine_type_serialize( - project_id=project_id, - machine_type=machine_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_machine_type_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[MachineType]: - """Get details about a machine type. - - Get details about a specific machine type. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param machine_type: STACKIT machine type Name. (required) - :type machine_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_machine_type_serialize( - project_id=project_id, - machine_type=machine_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_machine_type_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - machine_type: Annotated[str, Field(strict=True, max_length=63, description="STACKIT machine type Name.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get details about a machine type. - - Get details about a specific machine type. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param machine_type: STACKIT machine type Name. (required) - :type machine_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_machine_type_serialize( - project_id=project_id, - machine_type=machine_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "MachineType", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_machine_type_serialize( - self, - project_id, - machine_type, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if machine_type is not None: - _path_params["machineType"] = machine_type - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/machine-types/{machineType}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_network( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Network: - """Get network details. - - Get details about a network of a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_network_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Network]: - """Get network details. - - Get details about a network of a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_network_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get network details. - - Get details about a network of a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param network_id: The identifier (ID) of a STACKIT Network. (required) - :type network_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_network_serialize( - project_id=project_id, - network_id=network_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Network", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_network_serialize( - self, - project_id, - network_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if network_id is not None: - _path_params["networkId"] = network_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def get_network_area( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkArea: - """Get details about a network area. - - Get details about a network area in an organization. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_network_area_with_http_info( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NetworkArea]: - """Get details about a network area. - - Get details about a network area in an organization. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_network_area_without_preload_content( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get details about a network area. - - Get details about a network area in an organization. - - :param organization_id: The identifier (ID) of a STACKIT Organization. (required) - :type organization_id: str - :param area_id: The identifier (ID) of a STACKIT Network Area. (required) - :type area_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._get_network_area_serialize( - organization_id=organization_id, - area_id=area_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_network_area_serialize( - self, - organization_id, - area_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if organization_id is not None: - _path_params["organizationId"] = organization_id - if area_id is not None: - _path_params["areaId"] = area_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/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."), - ], - all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, - _request_timeout: Union[ - None, - 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 all: List all Images. - :type all: bool - :param label_selector: Filter resources by labels. - :type label_selector: str - :param _request_timeout: timeout setting for this request. If one - 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, - all=all, - 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."), - ], - all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, - _request_timeout: Union[ - None, - 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 all: List all Images. - :type all: bool - :param label_selector: Filter resources by labels. - :type label_selector: str - :param _request_timeout: timeout setting for this request. If one - 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, - all=all, - 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."), - ], - all: Annotated[Optional[StrictBool], Field(description="List all Images.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, - _request_timeout: Union[ - None, - 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 all: List all Images. - :type all: bool - :param label_selector: Filter resources by labels. - :type label_selector: str - :param _request_timeout: timeout setting for this request. If one - 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, - all=all, - 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, - all, - 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 all is not None: - - _query_params.append(("all", all)) - - 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."), - ], - filter: Annotated[ - Optional[StrictStr], - Field( - description="Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details." - ), - ] = 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, - ) -> 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 filter: Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. - :type filter: str - :param _request_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, - filter=filter, - _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."), - ], - filter: Annotated[ - Optional[StrictStr], - Field( - description="Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details." - ), - ] = 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[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 filter: Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. - :type filter: str - :param _request_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, - filter=filter, - _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."), - ], - filter: Annotated[ - Optional[StrictStr], - Field( - description="Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details." - ), - ] = 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 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 filter: Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. - :type filter: str - :param _request_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, - filter=filter, - _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, - filter, - _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 filter is not None: - - _query_params.append(("filter", filter)) - - # 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."), - ], - 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 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) - return response_data.response - - def _list_volume_performance_classes_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}/volume-performance-classes", - 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_volumes( - 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, - ) -> VolumeListResponse: - """List all volumes inside a project. - - Get a list of all volumes inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :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_volumes_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": "VolumeListResponse", - "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_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."), - ], - 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[VolumeListResponse]: - """List all volumes inside a project. - - Get a list of all volumes inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :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_volumes_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": "VolumeListResponse", - "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_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."), - ], - 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 volumes inside a project. - - Get a list of all volumes inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :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_volumes_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": "VolumeListResponse", - "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_volumes_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}/volumes", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update network settings. - - 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 - (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._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]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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)], - 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]: - """Update network settings. - - 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 - (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._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]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update network settings. - - 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 - (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._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]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _partial_update_network_serialize( - self, - project_id, - network_id, - partial_update_network_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if 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="PATCH", - resource_path="/v1alpha1/projects/{projectId}/networks/{networkId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def partial_update_network_area( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - partial_update_network_area_payload: Annotated[ - PartialUpdateNetworkAreaPayload, Field(description="Request to update an Area.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NetworkArea: - """Update network area settings. - - Update the settings of 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 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 - (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._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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def partial_update_network_area_with_http_info( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - partial_update_network_area_payload: Annotated[ - PartialUpdateNetworkAreaPayload, Field(description="Request to update an Area.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NetworkArea]: - """Update network area settings. - - Update the settings of 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 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 - (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._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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "NetworkArea", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def partial_update_network_area_without_preload_content( - self, - organization_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Organization." - ), - ], - area_id: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." - ), - ], - partial_update_network_area_payload: Annotated[ - PartialUpdateNetworkAreaPayload, Field(description="Request to update an 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: - """Update network area settings. - - Update the settings of 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 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 - (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._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, - _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 _partial_update_network_area_serialize( - self, - organization_id, - area_id, - partial_update_network_area_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if 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 partial_update_network_area_payload is not None: - _body_params = partial_update_network_area_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PATCH", - resource_path="/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 reboot_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."), - ], - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Reboot the server. - - Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param action: Defines if it is a soft or a hard reboot. - :type action: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._reboot_server_serialize( - project_id=project_id, - server_id=server_id, - action=action, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - action: Annotated[Optional[StrictStr], Field(description="Defines if it is a soft or a hard reboot.")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - 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]: - """Reboot the server. - - Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param action: Defines if it is a soft or a hard reboot. - :type action: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._reboot_server_serialize( - project_id=project_id, - server_id=server_id, - action=action, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - action: Annotated[Optional[StrictStr], Field(description="Defines if it is a soft or a hard reboot.")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - 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: - """Reboot the server. - - Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param action: Defines if it is a soft or a hard reboot. - :type action: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._reboot_server_serialize( - project_id=project_id, - server_id=server_id, - action=action, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _reboot_server_serialize( - self, - project_id, - server_id, - action, - _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 action is not None: - - _query_params.append(("action", action)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/reboot", - 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 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."), - ], - 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)], - 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: - """Remove a member from the virtual IP. - - Atomically remove a member from the virtual IP. - - :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 _request_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._remove_member_from_virtual_ip_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, - _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 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."), - ], - 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)], - 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]: - """Remove a member from the virtual IP. - - Atomically remove a member from the virtual IP. - - :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 _request_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._remove_member_from_virtual_ip_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, - _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 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."), - ], - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Remove a member from the virtual IP. - - Atomically remove a member from the virtual IP. - - :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 _request_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._remove_member_from_virtual_ip_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, - _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 _remove_member_from_virtual_ip_serialize( - self, - project_id, - network_id, - virtual_ip_id, - remove_member_from_virtual_ip_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if 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 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="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, - 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 remove_network_from_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."), - ], - network_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Detach and delete all network interfaces associated with the specified network. - - 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 - (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._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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def remove_network_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."), - ], - server_id: Annotated[ - 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)], - 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]: - """Detach and delete all network interfaces associated with the specified network. - - 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 - (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._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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def remove_network_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."), - ], - server_id: Annotated[ - 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)], - 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: - """Detach and delete all network interfaces associated with the specified network. - - 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 - (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._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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _remove_network_from_server_serialize( - self, - project_id, - server_id, - network_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if network_id is not None: - _path_params["networkId"] = network_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def remove_nic_from_server( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Detach a network interface. - - 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 - (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._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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def remove_nic_from_server_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - 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]: - """Detach a network interface. - - 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 - (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._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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def remove_nic_from_server_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - nic_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a network interface."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - 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: - """Detach a network interface. - - 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 - (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._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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _remove_nic_from_server_serialize( - self, - project_id, - server_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 server_id is not None: - _path_params["serverId"] = server_id - if nic_id is not None: - _path_params["nicId"] = nic_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/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 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."), - ], - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Dissociate a public IP from a server. - - Dissociate a public IP on an existing 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 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._remove_public_ip_from_server_serialize( - project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "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 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."), - ], - 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)], - 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]: - """Dissociate a public IP from a server. - - Dissociate a public IP on an existing 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 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._remove_public_ip_from_server_serialize( - project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "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 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."), - ], - 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)], - 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: - """Dissociate a public IP from a server. - - Dissociate a public IP on an existing 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 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._remove_public_ip_from_server_serialize( - project_id=project_id, - server_id=server_id, - public_ip_id=public_ip_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "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( - self, - project_id, - server_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 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 - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/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 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Remove a server from a security group. - - Remove a server from a attached security group. - - :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 - (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._remove_security_group_from_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Remove a server from a security group. - - Remove a server from a attached security group. - - :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 - (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._remove_security_group_from_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Remove a server from a security group. - - Remove a server from a attached security group. - - :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 - (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._remove_security_group_from_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _remove_security_group_from_server_serialize( - self, - project_id, - server_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 server_id is not None: - _path_params["serverId"] = server_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/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 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."), - ], - 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)], - 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: - """Detach a service account from a server. - - Detach an additional service account 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 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 - (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._remove_service_account_from_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - 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."), - ], - 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)], - 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]: - """Detach a service account from a server. - - Detach an additional service account 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 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 - (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._remove_service_account_from_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - 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."), - ], - 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)], - 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: - """Detach a service account from a server. - - Detach an additional service account 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 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 - (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._remove_service_account_from_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "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 _remove_service_account_from_server_serialize( - self, - project_id, - server_id, - service_account_mail, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if service_account_mail is not None: - _path_params["serviceAccountMail"] = service_account_mail - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}", - 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 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Detach a volume from a server. - - Detach an existing volume from an existing 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 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._remove_volume_from_server_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Detach a volume from a server. - - Detach an existing volume from an existing 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 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._remove_volume_from_server_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - volume_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Volume."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Detach a volume from a server. - - Detach an existing volume from an existing 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 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._remove_volume_from_server_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _remove_volume_from_server_serialize( - self, - project_id, - server_id, - volume_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - if volume_id is not None: - _path_params["volumeId"] = volume_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def rescue_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."), - ], - rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Rescue an existing server. - - Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._rescue_server_serialize( - project_id=project_id, - server_id=server_id, - rescue_server_payload=rescue_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def rescue_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."), - ], - rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], - _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]: - """Rescue an existing server. - - Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._rescue_server_serialize( - project_id=project_id, - server_id=server_id, - rescue_server_payload=rescue_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def rescue_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."), - ], - rescue_server_payload: Annotated[RescueServerPayload, Field(description="Request a server rescue.")], - _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: - """Rescue an existing server. - - Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param rescue_server_payload: Request a server rescue. (required) - :type rescue_server_payload: RescueServerPayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (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._rescue_server_serialize( - project_id=project_id, - server_id=server_id, - rescue_server_payload=rescue_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _rescue_server_serialize( - self, - project_id, - server_id, - rescue_server_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if 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 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}/rescue", - 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 resize_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."), - ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Resize a server. - - Resize the server to the given machine type. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param 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 - (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._resize_server_serialize( - project_id=project_id, - server_id=server_id, - resize_server_payload=resize_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], - _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]: - """Resize a server. - - Resize the server to the given machine type. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param 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 - (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._resize_server_serialize( - project_id=project_id, - server_id=server_id, - resize_server_payload=resize_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - resize_server_payload: Annotated[ResizeServerPayload, Field(description="Request a resize of a server.")], - _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: - """Resize a server. - - Resize the server to the given machine type. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param 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 - (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._resize_server_serialize( - project_id=project_id, - server_id=server_id, - resize_server_payload=resize_server_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _resize_server_serialize( - self, - project_id, - server_id, - resize_server_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if 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 resize_server_payload is not None: - _body_params = resize_server_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/resize", - 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 resize_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."), - ], - resize_volume_payload: Annotated[ - Optional[ResizeVolumePayload], Field(description="Request a volume resize.") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the size of a volume. - - 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 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 - (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._resize_volume_serialize( - project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - volume_id: Annotated[ - str, - 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)], - 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]: - """Update the size of a volume. - - 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 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 - (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._resize_volume_serialize( - project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - volume_id: Annotated[ - str, - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the size of a volume. - - 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 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 - (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._resize_volume_serialize( - project_id=project_id, - volume_id=volume_id, - resize_volume_payload=resize_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _resize_volume_serialize( - self, - project_id, - volume_id, - resize_volume_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - 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="POST", - resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize", - 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 restore_backup( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Restore Backup to the referenced source Volume. - - 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 backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._restore_backup_serialize( - project_id=project_id, - backup_id=backup_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Restore Backup to the referenced source Volume. - - 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 backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._restore_backup_serialize( - project_id=project_id, - backup_id=backup_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Restore Backup to the referenced source Volume. - - 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 backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._restore_backup_serialize( - project_id=project_id, - backup_id=backup_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _restore_backup_serialize( - self, - project_id, - backup_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if backup_id is not None: - _path_params["backupId"] = backup_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/backups/{backupId}/restore", - 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 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."), - ], - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageShare: - """Set image share. - - 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 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 - (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._set_image_share_serialize( - project_id=project_id, - image_id=image_id, - set_image_share_payload=set_image_share_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ImageShare]: - """Set image share. - - 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 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 - (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._set_image_share_serialize( - project_id=project_id, - image_id=image_id, - set_image_share_payload=set_image_share_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - 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)], - 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: - """Set image share. - - 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 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 - (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._set_image_share_serialize( - project_id=project_id, - image_id=image_id, - set_image_share_payload=set_image_share_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _set_image_share_serialize( - self, - project_id, - image_id, - set_image_share_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if 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="PUT", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def start_server( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Boot up a server. - - Start an existing server or allocates the server if deallocated. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_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._start_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def start_server_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Boot up a server. - - Start an existing server or allocates the server if deallocated. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_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._start_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def start_server_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Boot up a server. - - Start an existing server or allocates the server if deallocated. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_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._start_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _start_server_serialize( - self, - project_id, - server_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/start", - 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 stop_server( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Stop an existing server. - - Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_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._stop_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def stop_server_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Stop an existing server. - - Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_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._stop_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def stop_server_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Stop an existing server. - - Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param server_id: The identifier (ID) of a STACKIT Server. (required) - :type server_id: str - :param _request_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._stop_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _stop_server_serialize( - self, - project_id, - server_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/stop", - 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 unrescue_server( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Unrescue 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 _request_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._unrescue_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def unrescue_server_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Unrescue 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 _request_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._unrescue_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def unrescue_server_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - server_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Server."), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Unrescue 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 _request_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._unrescue_server_serialize( - project_id=project_id, - server_id=server_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _unrescue_server_serialize( - self, - project_id, - server_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def update_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."), - ], - update_attached_volume_payload: Annotated[ - UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeAttachment: - """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 - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_attached_volume_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def update_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."), - ], - update_attached_volume_payload: Annotated[ - UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumeAttachment]: - """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 - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_attached_volume_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def update_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."), - ], - update_attached_volume_payload: Annotated[ - UpdateAttachedVolumePayload, Field(description="Request a volume attachment update.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update 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 - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_attached_volume_serialize( - project_id=project_id, - server_id=server_id, - volume_id=volume_id, - update_attached_volume_payload=update_attached_volume_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeAttachment", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _update_attached_volume_serialize( - self, - project_id, - server_id, - volume_id, - update_attached_volume_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - 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 update_attached_volume_payload is not None: - _body_params = update_attached_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="PATCH", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def update_backup( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Backup: - """Update information of a backup. - - Update name or labels of the backup. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_backup_serialize( - project_id=project_id, - backup_id=backup_id, - update_backup_payload=update_backup_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Backup]: - """Update information of a backup. - - Update name or labels of the backup. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_backup_serialize( - project_id=project_id, - backup_id=backup_id, - update_backup_payload=update_backup_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - backup_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Backup."), - ], - update_backup_payload: Annotated[UpdateBackupPayload, Field(description="Request an update of a backup.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update information of a backup. - - Update name or labels of the backup. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param backup_id: The identifier (ID) of a STACKIT Backup. (required) - :type backup_id: str - :param 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_backup_serialize( - project_id=project_id, - backup_id=backup_id, - update_backup_payload=update_backup_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Backup", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _update_backup_serialize( - self, - project_id, - backup_id, - update_backup_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if 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 update_backup_payload is not None: - _body_params = update_backup_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/backups/{backupId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def update_image( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Image: - """Update Image Parameters. - - Update the properties of an existing Image inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param update_image_payload: Request an update of an Image. (required) - :type update_image_payload: UpdateImagePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_serialize( - project_id=project_id, - image_id=image_id, - update_image_payload=update_image_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def update_image_with_http_info( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Image]: - """Update Image Parameters. - - Update the properties of an existing Image inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param update_image_payload: Request an update of an Image. (required) - :type update_image_payload: UpdateImagePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_serialize( - project_id=project_id, - image_id=image_id, - update_image_payload=update_image_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def update_image_without_preload_content( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - update_image_payload: Annotated[UpdateImagePayload, Field(description="Request an update of an Image.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update Image Parameters. - - Update the properties of an existing Image inside a project. - - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param update_image_payload: Request an update of an Image. (required) - :type update_image_payload: UpdateImagePayload - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_serialize( - project_id=project_id, - image_id=image_id, - update_image_payload=update_image_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _update_image_serialize( - self, - project_id, - image_id, - update_image_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_image_payload is not None: - _body_params = update_image_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def update_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."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Image: - """Update Image Scope to Local. - - 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 image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_scope_local_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Image]: - """Update Image Scope to Local. - - 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 image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_scope_local_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update Image Scope to Local. - - 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 image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_scope_local_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _update_image_scope_local_serialize( - self, - project_id, - image_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/publish", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def update_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."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Image: - """Update Image Scope to Public. - - 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 image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_scope_public_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Image]: - """Update Image Scope to Public. - - 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 image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_scope_public_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update Image Scope to Public. - - 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 image_id: The identifier (ID) of a STACKIT Image. (required) - :type image_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_scope_public_serialize( - project_id=project_id, - image_id=image_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Image", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _update_image_scope_public_serialize( - self, - project_id, - image_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/publish", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def update_image_share( - self, - project_id: Annotated[ - str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), - ], - image_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Image.") - ], - update_image_share_payload: Annotated[UpdateImageSharePayload, Field(description="Update an Image Share.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageShare: - """Update image share. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_share_serialize( - project_id=project_id, - image_id=image_id, - update_image_share_payload=update_image_share_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def 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."), - ], - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ImageShare]: - """Update image share. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_share_serialize( - project_id=project_id, - image_id=image_id, - update_image_share_payload=update_image_share_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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."), - ], - 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)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update image share. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_image_share_serialize( - project_id=project_id, - image_id=image_id, - update_image_share_payload=update_image_share_payload, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ImageShare", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _update_image_share_serialize( - self, - project_id, - image_id, - update_image_share_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if image_id is not None: - _path_params["imageId"] = image_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if update_image_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="PATCH", - resource_path="/v1alpha1/projects/{projectId}/images/{imageId}/share", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def update_key_pair( - 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.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Keypair: - """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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def update_key_pair_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.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Keypair]: - """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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def 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.") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update information of 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_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, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Keypair", - "400": "Error", - "401": "Error", - "403": "Error", - "404": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _update_key_pair_serialize( - self, - keypair_name, - update_key_pair_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if 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_key_pair_payload is not None: - _body_params = update_key_pair_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1alpha1/keypairs/{keypairName}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - def update_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."), - ], - update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update 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: - """Update a network interface. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, - update_nic_payload=update_nic_payload, - _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", - "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 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."), - ], - 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."), - ], - update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update 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]: - """Update a network interface. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, - update_nic_payload=update_nic_payload, - _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", - "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 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."), - ], - 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."), - ], - update_nic_payload: Annotated[UpdateNicPayload, Field(description="Request an update 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: - """Update a network interface. - - 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 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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._update_nic_serialize( - project_id=project_id, - network_id=network_id, - nic_id=nic_id, - update_nic_payload=update_nic_payload, - _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", - "409": "Error", - "500": "Error", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _update_nic_serialize( - self, - project_id, - network_id, - nic_id, - update_nic_payload, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if 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_nic_payload is not None: - _body_params = update_nic_payload - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/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 update_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.") - ], - update_public_ip_payload: Annotated[ - UpdatePublicIPPayload, Field(description="Request an update 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: - """Update a public IP. - - Update the properties of an existing 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 update_public_ip_payload: Request an update of a public IP. (required) - :type update_public_ip_payload: UpdatePublicIPPayload + :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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -34780,12 +2733,13 @@ def update_public_ip( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_public_ip_serialize( - project_id=project_id, - public_ip_id=public_ip_id, - update_public_ip_payload=update_public_ip_payload, + _param = self._get_routing_table_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -34793,7 +2747,7 @@ def update_public_ip( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "RoutingTable", "400": "Error", "401": "Error", "403": "Error", @@ -34808,17 +2762,26 @@ def update_public_ip( ).data @validate_call - def update_public_ip_with_http_info( + def get_routing_table_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." + ), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - update_public_ip_payload: Annotated[ - UpdatePublicIPPayload, Field(description="Request an update of a public IP.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], _request_timeout: Union[ None, @@ -34829,17 +2792,19 @@ 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[RoutingTable]: + """Get details about a routing table. - Update the properties of an existing public IP inside a project. + Get details about a routing table defined in a network area. - :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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -34860,12 +2825,13 @@ def update_public_ip_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_public_ip_serialize( - project_id=project_id, - public_ip_id=public_ip_id, - update_public_ip_payload=update_public_ip_payload, + _param = self._get_routing_table_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -34873,7 +2839,7 @@ def update_public_ip_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "RoutingTable", "400": "Error", "401": "Error", "403": "Error", @@ -34888,17 +2854,26 @@ def update_public_ip_with_http_info( ) @validate_call - def update_public_ip_without_preload_content( + def get_routing_table_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." + ), ], - public_ip_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a Public IP.") + area_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], - update_public_ip_payload: Annotated[ - UpdatePublicIPPayload, Field(description="Request an update of a public IP.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], _request_timeout: Union[ None, @@ -34910,16 +2885,18 @@ 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. + """Get details about a routing table. - Update the properties of an existing public IP inside a project. + Get details about a routing table defined in a network area. - :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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -34940,12 +2917,13 @@ def update_public_ip_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_public_ip_serialize( - project_id=project_id, - public_ip_id=public_ip_id, - update_public_ip_payload=update_public_ip_payload, + _param = self._get_routing_table_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -34953,7 +2931,7 @@ def update_public_ip_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PublicIp", + "200": "RoutingTable", "400": "Error", "401": "Error", "403": "Error", @@ -34963,11 +2941,12 @@ 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 _get_routing_table_of_area_serialize( self, - project_id, - public_ip_id, - update_public_ip_payload, + organization_id, + area_id, + region, + routing_table_id, _request_auth, _content_type, _headers, @@ -34982,39 +2961,33 @@ def _update_public_ip_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if public_ip_id is not None: - _path_params["publicIpId"] = public_ip_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if region is not None: + _path_params["region"] = region + if routing_table_id is not None: + _path_params["routingTableId"] = routing_table_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 # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/public-ips/{publicIpId}", + method="GET", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -35028,24 +3001,14 @@ def _update_public_ip_serialize( ) @validate_call - def update_security_group( + 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."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - update_security_group_payload: Annotated[ - UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") - ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35055,17 +3018,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. + ) -> NetworkListResponse: + """List all networks inside a project. - Update labels of the security group. + 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 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -35086,12 +3049,12 @@ def update_security_group( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_security_group_serialize( + _param = self._list_networks_serialize( project_id=project_id, - security_group_id=security_group_id, - update_security_group_payload=update_security_group_payload, + region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35099,7 +3062,7 @@ def update_security_group( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35114,24 +3077,14 @@ def update_security_group( ).data @validate_call - def update_security_group_with_http_info( + def list_networks_with_http_info( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - update_security_group_payload: Annotated[ - UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") - ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35141,17 +3094,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[NetworkListResponse]: + """List all networks inside a project. - Update labels of the security group. + 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 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -35172,12 +3125,12 @@ def update_security_group_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_security_group_serialize( + _param = self._list_networks_serialize( project_id=project_id, - security_group_id=security_group_id, - update_security_group_payload=update_security_group_payload, + region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35185,7 +3138,7 @@ def update_security_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35200,24 +3153,14 @@ def update_security_group_with_http_info( ) @validate_call - def update_security_group_without_preload_content( + def list_networks_without_preload_content( self, project_id: Annotated[ str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Project."), ], - security_group_id: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The identifier (ID) of a STACKIT Security Group.", - ), - ], - update_security_group_payload: Annotated[ - UpdateSecurityGroupPayload, Field(description="Request an update of a security group.") - ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35228,16 +3171,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. + """List all networks inside a project. - Update labels of the security group. + 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 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -35258,12 +3201,12 @@ def update_security_group_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_security_group_serialize( + _param = self._list_networks_serialize( project_id=project_id, - security_group_id=security_group_id, - update_security_group_payload=update_security_group_payload, + region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35271,7 +3214,7 @@ def update_security_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "SecurityGroup", + "200": "NetworkListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35281,11 +3224,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 _list_networks_serialize( self, project_id, - security_group_id, - update_security_group_payload, + region, + label_selector, _request_auth, _content_type, _headers, @@ -35300,39 +3243,33 @@ def _update_security_group_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if security_group_id is not None: - _path_params["securityGroupId"] = security_group_id + if region is not None: + _path_params["region"] = region # 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 update_security_group_payload is not None: - _body_params = update_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="PATCH", - resource_path="/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}", + method="GET", + resource_path="/v2alpha1/projects/{projectId}/regions/{region}/networks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -35346,17 +3283,28 @@ def _update_security_group_serialize( ) @validate_call - def update_server( + def list_routes_of_routing_table( 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." + ), ], - server_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." + ), ], - update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35366,17 +3314,21 @@ 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. + ) -> RouteListResponse: + """List all routes in a routing table. - Update name or labels of the server. + Get a list of all routes in a routing table. - :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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -35397,12 +3349,14 @@ def update_server( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_server_serialize( - project_id=project_id, - server_id=server_id, - update_server_payload=update_server_payload, + _param = self._list_routes_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35410,7 +3364,7 @@ def update_server( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35425,17 +3379,28 @@ def update_server( ).data @validate_call - def update_server_with_http_info( + def list_routes_of_routing_table_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." + ), ], - server_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." + ), ], - update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35445,17 +3410,21 @@ 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[RouteListResponse]: + """List all routes in a routing table. - Update name or labels of the server. + Get a list of all routes in a routing table. - :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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -35476,12 +3445,14 @@ def update_server_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_server_serialize( - project_id=project_id, - server_id=server_id, - update_server_payload=update_server_payload, + _param = self._list_routes_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35489,7 +3460,7 @@ def update_server_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35504,17 +3475,28 @@ def update_server_with_http_info( ) @validate_call - def update_server_without_preload_content( + def list_routes_of_routing_table_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." + ), ], - server_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." + ), ], - update_server_payload: Annotated[UpdateServerPayload, Field(description="Request an update of a server.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35525,16 +3507,20 @@ 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. + """List all routes in a routing table. - Update name or labels of the server. + Get a list of all routes in a routing table. - :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 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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_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 @@ -35555,12 +3541,14 @@ def update_server_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_server_serialize( - project_id=project_id, - server_id=server_id, - update_server_payload=update_server_payload, + _param = self._list_routes_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35568,7 +3556,7 @@ def update_server_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Server", + "200": "RouteListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35578,11 +3566,13 @@ 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 _list_routes_of_routing_table_serialize( self, - project_id, - server_id, - update_server_payload, + organization_id, + area_id, + region, + routing_table_id, + label_selector, _request_auth, _content_type, _headers, @@ -35597,39 +3587,37 @@ def _update_server_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if server_id is not None: - _path_params["serverId"] = server_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if region is not None: + _path_params["region"] = region + if routing_table_id is not None: + _path_params["routingTableId"] = routing_table_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 update_server_payload is not None: - _body_params = update_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="PATCH", - resource_path="/v1alpha1/projects/{projectId}/servers/{serverId}", + method="GET", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -35643,19 +3631,22 @@ def _update_server_serialize( ) @validate_call - def update_snapshot( + def list_routing_tables_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." + ), ], - snapshot_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), - ], - update_snapshot_payload: Annotated[ - UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35665,17 +3656,19 @@ def update_snapshot( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Snapshot: - """Update information of the snapshot. - - Update information like name or labels of the snapshot. + ) -> RoutingTableListResponse: + """List all routing tables in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) - :type snapshot_id: str - :param update_snapshot_payload: Request an update of a snapshot. (required) - :type update_snapshot_payload: UpdateSnapshotPayload + Get a list of all routing tables 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -35696,12 +3689,13 @@ def update_snapshot( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_snapshot_serialize( - project_id=project_id, - snapshot_id=snapshot_id, - update_snapshot_payload=update_snapshot_payload, + _param = self._list_routing_tables_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35709,7 +3703,7 @@ def update_snapshot( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Snapshot", + "200": "RoutingTableListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35724,19 +3718,22 @@ def update_snapshot( ).data @validate_call - def update_snapshot_with_http_info( + def list_routing_tables_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." + ), ], - snapshot_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), - ], - update_snapshot_payload: Annotated[ - UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35746,17 +3743,19 @@ def update_snapshot_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[Snapshot]: - """Update information of the snapshot. + ) -> ApiResponse[RoutingTableListResponse]: + """List all routing tables in a network area. - Update information like name or labels of the snapshot. + Get a list of all routing tables in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) - :type snapshot_id: str - :param update_snapshot_payload: Request an update of a snapshot. (required) - :type update_snapshot_payload: UpdateSnapshotPayload + :param 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -35777,12 +3776,13 @@ def update_snapshot_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_snapshot_serialize( - project_id=project_id, - snapshot_id=snapshot_id, - update_snapshot_payload=update_snapshot_payload, + _param = self._list_routing_tables_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35790,7 +3790,7 @@ def update_snapshot_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Snapshot", + "200": "RoutingTableListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35805,19 +3805,22 @@ def update_snapshot_with_http_info( ) @validate_call - def update_snapshot_without_preload_content( + def list_routing_tables_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." + ), ], - snapshot_id: Annotated[ + area_id: Annotated[ str, - Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Snapshot."), - ], - update_snapshot_payload: Annotated[ - UpdateSnapshotPayload, Field(description="Request an update of a snapshot.") + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Network Area." + ), ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter resources by labels.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -35828,16 +3831,18 @@ def update_snapshot_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update information of the snapshot. + """List all routing tables in a network area. - Update information like name or labels of the snapshot. + Get a list of all routing tables in a network area. - :param project_id: The identifier (ID) of a STACKIT Project. (required) - :type project_id: str - :param snapshot_id: The identifier (ID) of a STACKIT Snapshot. (required) - :type snapshot_id: str - :param update_snapshot_payload: Request an update of a snapshot. (required) - :type update_snapshot_payload: UpdateSnapshotPayload + :param 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 region: The STACKIT Region of the resources. (required) + :type region: 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 @@ -35858,12 +3863,13 @@ def update_snapshot_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_snapshot_serialize( - project_id=project_id, - snapshot_id=snapshot_id, - update_snapshot_payload=update_snapshot_payload, + _param = self._list_routing_tables_of_area_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -35871,7 +3877,7 @@ def update_snapshot_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Snapshot", + "200": "RoutingTableListResponse", "400": "Error", "401": "Error", "403": "Error", @@ -35881,11 +3887,12 @@ def update_snapshot_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_snapshot_serialize( + def _list_routing_tables_of_area_serialize( self, - project_id, - snapshot_id, - update_snapshot_payload, + organization_id, + area_id, + region, + label_selector, _request_auth, _content_type, _headers, @@ -35900,39 +3907,35 @@ def _update_snapshot_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if snapshot_id is not None: - _path_params["snapshotId"] = snapshot_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if region is not None: + _path_params["region"] = region # 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 update_snapshot_payload is not None: - _body_params = update_snapshot_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/snapshots/{snapshotId}", + method="GET", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -35946,21 +3949,19 @@ def _update_snapshot_serialize( ) @validate_call - def update_virtual_ip( + 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."), ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], 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.") - ], - update_virtual_ip_payload: Annotated[ - UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") + partial_update_network_payload: Annotated[ + PartialUpdateNetworkPayload, Field(description="Request an update of a network.") ], _request_timeout: Union[ None, @@ -35972,18 +3973,18 @@ def update_virtual_ip( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Update a virtual IP. + """Update network settings. - Update the properties of an existing virtual IP inside a project. + 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 region: The STACKIT Region of the resources. (required) + :type region: 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 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 @@ -36004,13 +4005,13 @@ def update_virtual_ip( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_virtual_ip_serialize( + _param = self._partial_update_network_serialize( project_id=project_id, + region=region, network_id=network_id, - virtual_ip_id=virtual_ip_id, - update_virtual_ip_payload=update_virtual_ip_payload, + partial_update_network_payload=partial_update_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36033,21 +4034,19 @@ def update_virtual_ip( ).data @validate_call - def update_virtual_ip_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."), ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], 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.") - ], - update_virtual_ip_payload: Annotated[ - UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") + partial_update_network_payload: Annotated[ + PartialUpdateNetworkPayload, Field(description="Request an update of a network.") ], _request_timeout: Union[ None, @@ -36059,18 +4058,18 @@ def update_virtual_ip_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Update a virtual IP. + """Update network settings. - Update the properties of an existing virtual IP inside a project. + 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 region: The STACKIT Region of the resources. (required) + :type region: 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 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 @@ -36091,13 +4090,13 @@ def update_virtual_ip_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_virtual_ip_serialize( + _param = self._partial_update_network_serialize( project_id=project_id, + region=region, network_id=network_id, - virtual_ip_id=virtual_ip_id, - update_virtual_ip_payload=update_virtual_ip_payload, + partial_update_network_payload=partial_update_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36120,21 +4119,19 @@ def update_virtual_ip_with_http_info( ) @validate_call - def update_virtual_ip_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."), ], + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], 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.") - ], - update_virtual_ip_payload: Annotated[ - UpdateVirtualIPPayload, Field(description="Request an update of a virtual IP.") + partial_update_network_payload: Annotated[ + PartialUpdateNetworkPayload, Field(description="Request an update of a network.") ], _request_timeout: Union[ None, @@ -36146,18 +4143,18 @@ 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 network settings. - Update the properties of an existing virtual IP inside a project. + 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 region: The STACKIT Region of the resources. (required) + :type region: 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 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 @@ -36178,13 +4175,13 @@ def update_virtual_ip_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_virtual_ip_serialize( + _param = self._partial_update_network_serialize( project_id=project_id, + region=region, network_id=network_id, - virtual_ip_id=virtual_ip_id, - update_virtual_ip_payload=update_virtual_ip_payload, + partial_update_network_payload=partial_update_network_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36202,12 +4199,12 @@ 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 _partial_update_network_serialize( self, project_id, + region, network_id, - virtual_ip_id, - update_virtual_ip_payload, + partial_update_network_payload, _request_auth, _content_type, _headers, @@ -36222,22 +4219,22 @@ def _update_virtual_ip_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region 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_virtual_ip_payload is not None: - _body_params = update_virtual_ip_payload + 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: @@ -36256,7 +4253,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="/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -36270,17 +4267,33 @@ def _update_virtual_ip_serialize( ) @validate_call - def update_volume( + def update_route_of_routing_table( 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." + ), ], - volume_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + update_route_of_routing_table_payload: Annotated[ + UpdateRouteOfRoutingTablePayload, Field(description="Request an update of a route in a routing table.") ], - update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -36290,17 +4303,23 @@ 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 route of a routing table. - Update name, description or labels of the volume. + Update a route defined in a routing table. - :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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_id: str + :param update_route_of_routing_table_payload: Request an update of a route in a routing table. (required) + :type update_route_of_routing_table_payload: UpdateRouteOfRoutingTablePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -36321,12 +4340,15 @@ def update_volume( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_volume_serialize( - project_id=project_id, - volume_id=volume_id, - update_volume_payload=update_volume_payload, + _param = self._update_route_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, + update_route_of_routing_table_payload=update_route_of_routing_table_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36334,7 +4356,7 @@ def update_volume( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -36349,17 +4371,33 @@ def update_volume( ).data @validate_call - def update_volume_with_http_info( + def update_route_of_routing_table_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." + ), ], - volume_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + update_route_of_routing_table_payload: Annotated[ + UpdateRouteOfRoutingTablePayload, Field(description="Request an update of a route in a routing table.") ], - update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -36369,17 +4407,23 @@ 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 route of a routing table. - Update name, description or labels of the volume. + Update a route defined in a routing table. - :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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_id: str + :param update_route_of_routing_table_payload: Request an update of a route in a routing table. (required) + :type update_route_of_routing_table_payload: UpdateRouteOfRoutingTablePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -36400,12 +4444,15 @@ def update_volume_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_volume_serialize( - project_id=project_id, - volume_id=volume_id, - update_volume_payload=update_volume_payload, + _param = self._update_route_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, + update_route_of_routing_table_payload=update_route_of_routing_table_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36413,7 +4460,7 @@ def update_volume_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -36428,17 +4475,33 @@ def update_volume_with_http_info( ) @validate_call - def update_volume_without_preload_content( + def update_route_of_routing_table_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." + ), ], - volume_id: Annotated[ + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_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 Routing Table." + ), + ], + route_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Route.") + ], + update_route_of_routing_table_payload: Annotated[ + UpdateRouteOfRoutingTablePayload, Field(description="Request an update of a route in a routing table.") ], - update_volume_payload: Annotated[UpdateVolumePayload, Field(description="Request an update of a volume.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -36449,16 +4512,22 @@ 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 route of a routing table. - Update name, description or labels of the volume. + Update a route defined in a routing table. - :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 region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param route_id: The identifier (ID) of a STACKIT Route. (required) + :type route_id: str + :param update_route_of_routing_table_payload: Request an update of a route in a routing table. (required) + :type update_route_of_routing_table_payload: UpdateRouteOfRoutingTablePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -36479,12 +4548,15 @@ def update_volume_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._update_volume_serialize( - project_id=project_id, - volume_id=volume_id, - update_volume_payload=update_volume_payload, + _param = self._update_route_of_routing_table_serialize( + organization_id=organization_id, + area_id=area_id, + region=region, + routing_table_id=routing_table_id, + route_id=route_id, + update_route_of_routing_table_payload=update_route_of_routing_table_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36492,7 +4564,7 @@ def update_volume_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Volume", + "200": "Route", "400": "Error", "401": "Error", "403": "Error", @@ -36502,11 +4574,14 @@ 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 _update_route_of_routing_table_serialize( self, - project_id, - volume_id, - update_volume_payload, + organization_id, + area_id, + region, + routing_table_id, + route_id, + update_route_of_routing_table_payload, _request_auth, _content_type, _headers, @@ -36521,20 +4596,26 @@ def _update_volume_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if volume_id is not None: - _path_params["volumeId"] = volume_id + if organization_id is not None: + _path_params["organizationId"] = organization_id + if area_id is not None: + _path_params["areaId"] = area_id + if region is not None: + _path_params["region"] = region + if routing_table_id is not None: + _path_params["routingTableId"] = routing_table_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 update_route_of_routing_table_payload is not None: + _body_params = update_route_of_routing_table_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -36553,7 +4634,7 @@ def _update_volume_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/projects/{projectId}/volumes/{volumeId}", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -36567,7 +4648,7 @@ def _update_volume_serialize( ) @validate_call - def v1alpha1_update_route_of_area( + def update_routing_table_of_area( self, organization_id: Annotated[ str, @@ -36581,11 +4662,15 @@ def v1alpha1_update_route_of_area( 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.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - v1alpha1_update_route_of_area_payload: Annotated[ - V1alpha1UpdateRouteOfAreaPayload, Field(description="Request an update of a network route.") + update_routing_table_of_area_payload: Annotated[ + UpdateRoutingTableOfAreaPayload, Field(description="Request an update of a routing table.") ], _request_timeout: Union[ None, @@ -36596,19 +4681,21 @@ def v1alpha1_update_route_of_area( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Route: - """Update a network route. + ) -> RoutingTable: + """Update a routing table. - Update a network route defined in a network area. + Update a routing table 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 v1alpha1_update_route_of_area_payload: Request an update of a network route. (required) - :type v1alpha1_update_route_of_area_payload: V1alpha1UpdateRouteOfAreaPayload + :param region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param update_routing_table_of_area_payload: Request an update of a routing table. (required) + :type update_routing_table_of_area_payload: UpdateRoutingTableOfAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -36629,13 +4716,14 @@ def v1alpha1_update_route_of_area( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._v1alpha1_update_route_of_area_serialize( + _param = self._update_routing_table_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, + region=region, + routing_table_id=routing_table_id, + update_routing_table_of_area_payload=update_routing_table_of_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36643,7 +4731,7 @@ def v1alpha1_update_route_of_area( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "RoutingTable", "400": "Error", "401": "Error", "403": "Error", @@ -36658,7 +4746,7 @@ def v1alpha1_update_route_of_area( ).data @validate_call - def v1alpha1_update_route_of_area_with_http_info( + def update_routing_table_of_area_with_http_info( self, organization_id: Annotated[ str, @@ -36672,11 +4760,15 @@ def v1alpha1_update_route_of_area_with_http_info( 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.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - v1alpha1_update_route_of_area_payload: Annotated[ - V1alpha1UpdateRouteOfAreaPayload, Field(description="Request an update of a network route.") + update_routing_table_of_area_payload: Annotated[ + UpdateRoutingTableOfAreaPayload, Field(description="Request an update of a routing table.") ], _request_timeout: Union[ None, @@ -36687,19 +4779,21 @@ def v1alpha1_update_route_of_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[Route]: - """Update a network route. + ) -> ApiResponse[RoutingTable]: + """Update a routing table. - Update a network route defined in a network area. + Update a routing table 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 v1alpha1_update_route_of_area_payload: Request an update of a network route. (required) - :type v1alpha1_update_route_of_area_payload: V1alpha1UpdateRouteOfAreaPayload + :param region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param update_routing_table_of_area_payload: Request an update of a routing table. (required) + :type update_routing_table_of_area_payload: UpdateRoutingTableOfAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -36720,13 +4814,14 @@ def v1alpha1_update_route_of_area_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._v1alpha1_update_route_of_area_serialize( + _param = self._update_routing_table_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, + region=region, + routing_table_id=routing_table_id, + update_routing_table_of_area_payload=update_routing_table_of_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36734,7 +4829,7 @@ def v1alpha1_update_route_of_area_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "RoutingTable", "400": "Error", "401": "Error", "403": "Error", @@ -36749,7 +4844,7 @@ def v1alpha1_update_route_of_area_with_http_info( ) @validate_call - def v1alpha1_update_route_of_area_without_preload_content( + def update_routing_table_of_area_without_preload_content( self, organization_id: Annotated[ str, @@ -36763,11 +4858,15 @@ def v1alpha1_update_route_of_area_without_preload_content( 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.") + region: Annotated[StrictStr, Field(description="The STACKIT Region of the resources.")], + routing_table_id: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The identifier (ID) of a STACKIT Routing Table." + ), ], - v1alpha1_update_route_of_area_payload: Annotated[ - V1alpha1UpdateRouteOfAreaPayload, Field(description="Request an update of a network route.") + update_routing_table_of_area_payload: Annotated[ + UpdateRoutingTableOfAreaPayload, Field(description="Request an update of a routing table.") ], _request_timeout: Union[ None, @@ -36779,18 +4878,20 @@ def v1alpha1_update_route_of_area_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a network route. + """Update a routing table. - Update a network route defined in a network area. + Update a routing table 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 v1alpha1_update_route_of_area_payload: Request an update of a network route. (required) - :type v1alpha1_update_route_of_area_payload: V1alpha1UpdateRouteOfAreaPayload + :param region: The STACKIT Region of the resources. (required) + :type region: str + :param routing_table_id: The identifier (ID) of a STACKIT Routing Table. (required) + :type routing_table_id: str + :param update_routing_table_of_area_payload: Request an update of a routing table. (required) + :type update_routing_table_of_area_payload: UpdateRoutingTableOfAreaPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -36811,13 +4912,14 @@ def v1alpha1_update_route_of_area_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 - _param = self._v1alpha1_update_route_of_area_serialize( + _param = self._update_routing_table_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, + region=region, + routing_table_id=routing_table_id, + update_routing_table_of_area_payload=update_routing_table_of_area_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -36825,7 +4927,7 @@ def v1alpha1_update_route_of_area_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Route", + "200": "RoutingTable", "400": "Error", "401": "Error", "403": "Error", @@ -36835,12 +4937,13 @@ def v1alpha1_update_route_of_area_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _v1alpha1_update_route_of_area_serialize( + def _update_routing_table_of_area_serialize( self, organization_id, area_id, - route_id, - v1alpha1_update_route_of_area_payload, + region, + routing_table_id, + update_routing_table_of_area_payload, _request_auth, _content_type, _headers, @@ -36855,7 +4958,7 @@ def _v1alpha1_update_route_of_area_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -36863,14 +4966,16 @@ def _v1alpha1_update_route_of_area_serialize( _path_params["organizationId"] = organization_id if area_id is not None: _path_params["areaId"] = area_id - if route_id is not None: - _path_params["routeId"] = route_id + if region is not None: + _path_params["region"] = region + if routing_table_id is not None: + _path_params["routingTableId"] = routing_table_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if v1alpha1_update_route_of_area_payload is not None: - _body_params = v1alpha1_update_route_of_area_payload + if update_routing_table_of_area_payload is not None: + _body_params = update_routing_table_of_area_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -36889,7 +4994,7 @@ def _v1alpha1_update_route_of_area_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}", + resource_path="/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/iaasalpha/src/stackit/iaasalpha/api_client.py b/services/iaasalpha/src/stackit/iaasalpha/api_client.py index 5b9061e2..9b2816b9 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/api_client.py +++ b/services/iaasalpha/src/stackit/iaasalpha/api_client.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/iaasalpha/src/stackit/iaasalpha/configuration.py b/services/iaasalpha/src/stackit/iaasalpha/configuration.py index 4c349206..18216fd4 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/configuration.py +++ b/services/iaasalpha/src/stackit/iaasalpha/configuration.py @@ -1,21 +1,38 @@ # coding: utf-8 -import sys - -import os - - """ IaaS-API This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -37,7 +54,7 @@ def __init__( ) """Constructor """ - self._base_path = "https://iaas.api.eu01.stackit.cloud" + self._base_path = "https://iaas.api.stackit.cloud" """Default Base url """ self.server_index = 0 if server_index is None else server_index @@ -54,26 +71,30 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings """ return [ { - "url": "https://iaas.api.{region}stackit.cloud", + "url": "https://iaas.api.stackit.cloud", "description": "No description provided", "variables": { "region": { "description": "No description provided", - "default_value": "eu01.", - "enum_values": ["eu01."], + "default_value": "global", } }, } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -113,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -132,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/iaasalpha/src/stackit/iaasalpha/exceptions.py b/services/iaasalpha/src/stackit/iaasalpha/exceptions.py index 9465d904..f9a897f7 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/exceptions.py +++ b/services/iaasalpha/src/stackit/iaasalpha/exceptions.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from typing import Any, Optional @@ -128,7 +128,7 @@ def __init__( if self.body is None: try: self.body = http_resp.data.decode("utf-8") - except Exception: # noqa: S110 + except Exception: pass self.headers = http_resp.getheaders() @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py b/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py index 83647c52..113df44d 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/__init__.py @@ -6,198 +6,63 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 # import models into model package -from stackit.iaasalpha.models.add_member_to_virtual_ip_payload import ( - AddMemberToVirtualIPPayload, +from stackit.iaasalpha.models.add_routes_to_routing_table_payload import ( + AddRoutesToRoutingTablePayload, ) -from stackit.iaasalpha.models.add_volume_to_server_payload import ( - AddVolumeToServerPayload, +from stackit.iaasalpha.models.add_routing_table_to_area_payload import ( + AddRoutingTableToAreaPayload, ) -from stackit.iaasalpha.models.affinity_group import AffinityGroup -from stackit.iaasalpha.models.affinity_group_list_response import ( - AffinityGroupListResponse, +from stackit.iaasalpha.models.create_network_ipv4 import CreateNetworkIPv4 +from stackit.iaasalpha.models.create_network_ipv4_with_prefix import ( + CreateNetworkIPv4WithPrefix, ) -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.create_network_ipv4_with_prefix_length import ( + CreateNetworkIPv4WithPrefixLength, ) -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_network_ipv6 import CreateNetworkIPv6 +from stackit.iaasalpha.models.create_network_ipv6_with_prefix import ( + CreateNetworkIPv6WithPrefix, ) -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_ipv6_with_prefix_length import ( + CreateNetworkIPv6WithPrefixLength, ) -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 -from stackit.iaasalpha.models.create_security_group_payload import ( - CreateSecurityGroupPayload, -) -from stackit.iaasalpha.models.create_security_group_rule_payload import ( - CreateSecurityGroupRulePayload, -) -from stackit.iaasalpha.models.create_security_group_rule_protocol import ( - CreateSecurityGroupRuleProtocol, -) -from stackit.iaasalpha.models.create_server_networking import CreateServerNetworking -from stackit.iaasalpha.models.create_server_networking_with_nics import ( - CreateServerNetworkingWithNics, -) -from stackit.iaasalpha.models.create_server_payload import CreateServerPayload -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.destination_cidrv4 import DestinationCIDRv4 +from stackit.iaasalpha.models.destination_cidrv6 import DestinationCIDRv6 from stackit.iaasalpha.models.error import Error -from stackit.iaasalpha.models.get_server_log200_response import GetServerLog200Response -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 -from stackit.iaasalpha.models.machine_type_list_response import MachineTypeListResponse from stackit.iaasalpha.models.network import Network -from stackit.iaasalpha.models.network_area import NetworkArea -from stackit.iaasalpha.models.network_area_ipv4 import NetworkAreaIPv4 -from stackit.iaasalpha.models.network_area_list_response import NetworkAreaListResponse +from stackit.iaasalpha.models.network_ipv4 import NetworkIPv4 +from stackit.iaasalpha.models.network_ipv6 import NetworkIPv6 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.nexthop_blackhole import NexthopBlackhole +from stackit.iaasalpha.models.nexthop_internet import NexthopInternet +from stackit.iaasalpha.models.nexthop_ipv4 import NexthopIPv4 +from stackit.iaasalpha.models.nexthop_ipv6 import NexthopIPv6 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 -from stackit.iaasalpha.models.protocol import Protocol -from stackit.iaasalpha.models.public_ip import PublicIp -from stackit.iaasalpha.models.public_ip_list_response import PublicIpListResponse -from stackit.iaasalpha.models.public_network import PublicNetwork -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, -) -from stackit.iaasalpha.models.request import Request -from stackit.iaasalpha.models.request_resource import RequestResource -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_destination import RouteDestination 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, -) -from stackit.iaasalpha.models.security_group_rule import SecurityGroupRule -from stackit.iaasalpha.models.security_group_rule_list_response import ( - SecurityGroupRuleListResponse, -) -from stackit.iaasalpha.models.security_group_rule_protocol import ( - SecurityGroupRuleProtocol, -) -from stackit.iaasalpha.models.server import Server -from stackit.iaasalpha.models.server_console_url import ServerConsoleUrl -from stackit.iaasalpha.models.server_list_response import ServerListResponse -from stackit.iaasalpha.models.server_maintenance import ServerMaintenance -from stackit.iaasalpha.models.server_network import ServerNetwork -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.route_nexthop import RouteNexthop +from stackit.iaasalpha.models.routing_table import RoutingTable +from stackit.iaasalpha.models.routing_table_list_response import ( + RoutingTableListResponse, ) 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 -from stackit.iaasalpha.models.volume_attachment import VolumeAttachment -from stackit.iaasalpha.models.volume_attachment_list_response import ( - VolumeAttachmentListResponse, +from stackit.iaasalpha.models.update_route_of_routing_table_payload import ( + UpdateRouteOfRoutingTablePayload, ) -from stackit.iaasalpha.models.volume_list_response import VolumeListResponse -from stackit.iaasalpha.models.volume_performance_class import VolumePerformanceClass -from stackit.iaasalpha.models.volume_performance_class_list_response import ( - VolumePerformanceClassListResponse, +from stackit.iaasalpha.models.update_routing_table_of_area_payload import ( + UpdateRoutingTableOfAreaPayload, ) -from stackit.iaasalpha.models.volume_source import VolumeSource diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/add_routes_to_routing_table_payload.py similarity index 81% rename from services/iaasalpha/src/stackit/iaasalpha/models/image_list_response.py rename to services/iaasalpha/src/stackit/iaasalpha/models/add_routes_to_routing_table_payload.py index 7ac4ab95..f96c1709 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/image_list_response.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/add_routes_to_routing_table_payload.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -21,15 +21,15 @@ from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Self -from stackit.iaasalpha.models.image import Image +from stackit.iaasalpha.models.route import Route -class ImageListResponse(BaseModel): - """ - Image list response. +class AddRoutesToRoutingTablePayload(BaseModel): """ + Object represents a request to add network routes. + """ # noqa: E501 - items: List[Image] = Field(description="A list containing image objects.") + items: List[Route] = Field(description="A list of routes.") __properties: ClassVar[List[str]] = ["items"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ImageListResponse from a JSON string""" + """Create an instance of AddRoutesToRoutingTablePayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ImageListResponse from a dict""" + """Create an instance of AddRoutesToRoutingTablePayload from a dict""" if obj is None: return None @@ -88,6 +88,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"items": [Image.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None} + {"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/security_group.py b/services/iaasalpha/src/stackit/iaasalpha/models/add_routing_table_to_area_payload.py similarity index 74% rename from services/iaasalpha/src/stackit/iaasalpha/models/security_group.py rename to services/iaasalpha/src/stackit/iaasalpha/models/add_routing_table_to_area_payload.py index 7b6e75cf..8e53c8af 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/security_group.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/add_routing_table_to_area_payload.py @@ -5,35 +5,37 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime 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.security_group_rule import SecurityGroupRule - -class SecurityGroup(BaseModel): - """ - Object that represents a security group. +class AddRoutingTableToAreaPayload(BaseModel): """ + An object representing a routing table. + """ # noqa: E501 created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) + default: Optional[StrictBool] = Field( + default=True, + description="This is the default routing table for this area. It can't be deleted and is used if the user does not specify it otherwise.", + ) description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) @@ -44,27 +46,21 @@ class SecurityGroup(BaseModel): default=None, description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) - name: Annotated[str, Field(strict=True, max_length=63)] = Field( + name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs." ) - rules: Optional[List[SecurityGroupRule]] = Field( - default=None, description="A list containing security group rule objects." - ) - stateful: Optional[StrictBool] = Field( - default=True, - description="Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server.", - ) + system_routes: Optional[StrictBool] = Field(default=True, alias="systemRoutes") updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) __properties: ClassVar[List[str]] = [ "createdAt", + "default", "description", "id", "labels", "name", - "rules", - "stateful", + "systemRoutes", "updatedAt", ] @@ -83,8 +79,8 @@ def id_validate_regular_expression(cls, 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]+)*$/") + if not re.match(r"^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$/") return value model_config = ConfigDict( @@ -104,7 +100,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SecurityGroup from a JSON string""" + """Create an instance of AddRoutingTableToAreaPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -124,8 +120,8 @@ def to_dict(self) -> Dict[str, Any]: excluded_fields: Set[str] = set( [ "created_at", + "default", "id", - "rules", "updated_at", ] ) @@ -135,18 +131,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in rules (list) - _items = [] - if self.rules: - for _item in self.rules: - if _item: - _items.append(_item.to_dict()) - _dict["rules"] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SecurityGroup from a dict""" + """Create an instance of AddRoutingTableToAreaPayload from a dict""" if obj is None: return None @@ -156,16 +145,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "createdAt": obj.get("createdAt"), + "default": obj.get("default") if obj.get("default") is not None else True, "description": obj.get("description"), "id": obj.get("id"), "labels": obj.get("labels"), "name": obj.get("name"), - "rules": ( - [SecurityGroupRule.from_dict(_item) for _item in obj["rules"]] - if obj.get("rules") is not None - else None - ), - "stateful": obj.get("stateful") if obj.get("stateful") is not None else True, + "systemRoutes": obj.get("systemRoutes") if obj.get("systemRoutes") is not None else True, "updatedAt": obj.get("updatedAt"), } ) diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/add_volume_to_server_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/add_volume_to_server_payload.py deleted file mode 100644 index d45240d7..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/add_volume_to_server_payload.py +++ /dev/null @@ -1,130 +0,0 @@ -# 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 - - -class AddVolumeToServerPayload(BaseModel): - """ - Object that represents a Volume attachment to a server. - """ - - delete_on_termination: Optional[StrictBool] = Field( - default=None, - description="Delete the volume during the termination of the server. Defaults to false.", - alias="deleteOnTermination", - ) - server_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="serverId" - ) - 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]] = ["deleteOnTermination", "serverId", "volumeId"] - - @field_validator("server_id") - def server_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 AddVolumeToServerPayload 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( - [ - "server_id", - "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 AddVolumeToServerPayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "deleteOnTermination": obj.get("deleteOnTermination"), - "serverId": obj.get("serverId"), - "volumeId": obj.get("volumeId"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/affinity_group.py b/services/iaasalpha/src/stackit/iaasalpha/models/affinity_group.py deleted file mode 100644 index 835257e9..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/affinity_group.py +++ /dev/null @@ -1,122 +0,0 @@ -# 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. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`." - ) - __properties: ClassVar[List[str]] = ["id", "members", "name", "policy"] - - @field_validator("id") - 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 deleted file mode 100644 index 8ad1d1fd..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/affinity_group_list_response.py +++ /dev/null @@ -1,97 +0,0 @@ -# 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/area.py b/services/iaasalpha/src/stackit/iaasalpha/models/area.py deleted file mode 100644 index 7e5b6cfd..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/area.py +++ /dev/null @@ -1,137 +0,0 @@ -# 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.network_range import NetworkRange -from stackit.iaasalpha.models.route import Route - - -class Area(BaseModel): - """ - The basic properties of a network area. - """ - - default_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.", alias="defaultNameservers" - ) - network_ranges: Optional[Annotated[List[NetworkRange], Field(min_length=1, max_length=64)]] = Field( - default=None, description="A list of network ranges.", alias="networkRanges" - ) - routes: Optional[List[Route]] = Field(default=None, description="A list of routes.") - transfer_network: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Classless Inter-Domain Routing (CIDR).", alias="transferNetwork" - ) - __properties: ClassVar[List[str]] = ["defaultNameservers", "networkRanges", "routes", "transferNetwork"] - - @field_validator("transfer_network") - def transfer_network_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 Area 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 network_ranges (list) - _items = [] - if self.network_ranges: - for _item in self.network_ranges: - if _item: - _items.append(_item.to_dict()) - _dict["networkRanges"] = _items - # override the default output from pydantic by calling `to_dict()` of each item in routes (list) - _items = [] - if self.routes: - for _item in self.routes: - if _item: - _items.append(_item.to_dict()) - _dict["routes"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Area from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "defaultNameservers": obj.get("defaultNameservers"), - "networkRanges": ( - [NetworkRange.from_dict(_item) for _item in obj["networkRanges"]] - if obj.get("networkRanges") is not None - else None - ), - "routes": ( - [Route.from_dict(_item) for _item in obj["routes"]] if obj.get("routes") is not None else None - ), - "transferNetwork": obj.get("transferNetwork"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/area_config.py b/services/iaasalpha/src/stackit/iaasalpha/models/area_config.py deleted file mode 100644 index 40d86a79..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/area_config.py +++ /dev/null @@ -1,134 +0,0 @@ -# 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.network_range import NetworkRange -from stackit.iaasalpha.models.route import Route - - -class AreaConfig(BaseModel): - """ - The basic network area object. - """ - - default_nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( - default=None, alias="defaultNameservers" - ) - network_ranges: Annotated[List[NetworkRange], Field(min_length=1, max_length=64)] = Field( - description="A list of network ranges.", alias="networkRanges" - ) - routes: Optional[List[Route]] = Field(default=None, description="A list of routes.") - transfer_network: Annotated[str, Field(strict=True)] = Field( - description="Classless Inter-Domain Routing (CIDR).", alias="transferNetwork" - ) - __properties: ClassVar[List[str]] = ["defaultNameservers", "networkRanges", "routes", "transferNetwork"] - - @field_validator("transfer_network") - def transfer_network_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match( - r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$", - value, - ): - raise ValueError( - r"must validate the regular expression /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/" - ) - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AreaConfig 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 network_ranges (list) - _items = [] - if self.network_ranges: - for _item in self.network_ranges: - if _item: - _items.append(_item.to_dict()) - _dict["networkRanges"] = _items - # override the default output from pydantic by calling `to_dict()` of each item in routes (list) - _items = [] - if self.routes: - for _item in self.routes: - if _item: - _items.append(_item.to_dict()) - _dict["routes"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AreaConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "defaultNameservers": obj.get("defaultNameservers"), - "networkRanges": ( - [NetworkRange.from_dict(_item) for _item in obj["networkRanges"]] - if obj.get("networkRanges") is not None - else None - ), - "routes": ( - [Route.from_dict(_item) for _item in obj["routes"]] if obj.get("routes") is not None else None - ), - "transferNetwork": obj.get("transferNetwork"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/area_prefix_config_ipv4.py b/services/iaasalpha/src/stackit/iaasalpha/models/area_prefix_config_ipv4.py deleted file mode 100644 index d177ca85..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/area_prefix_config_ipv4.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 - - -class AreaPrefixConfigIPv4(BaseModel): - """ - The IPv4 prefix config for a network area. - """ - - default_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( - default=None, - description="The default prefix length for networks in the network area.", - alias="defaultPrefixLen", - ) - max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( - default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" - ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( - default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" - ) - __properties: ClassVar[List[str]] = ["defaultPrefixLen", "maxPrefixLen", "minPrefixLen"] - - 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 AreaPrefixConfigIPv4 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 AreaPrefixConfigIPv4 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "defaultPrefixLen": obj.get("defaultPrefixLen"), - "maxPrefixLen": obj.get("maxPrefixLen"), - "minPrefixLen": obj.get("minPrefixLen"), - } - ) - 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 deleted file mode 100644 index e06a8a14..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/availability_zone_list_response.py +++ /dev/null @@ -1,82 +0,0 @@ -# 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 deleted file mode 100644 index cb3ff573..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/backup.py +++ /dev/null @@ -1,202 +0,0 @@ -# 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - 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. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - 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 deleted file mode 100644 index db402242..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/backup_list_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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 deleted file mode 100644 index f53381f7..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/backup_source.py +++ /dev/null @@ -1,95 +0,0 @@ -# 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. Possible values: `volume`, `snapshot`.") - __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/base_security_group_rule.py b/services/iaasalpha/src/stackit/iaasalpha/models/base_security_group_rule.py deleted file mode 100644 index c4210e81..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/base_security_group_rule.py +++ /dev/null @@ -1,194 +0,0 @@ -# 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 - -from stackit.iaasalpha.models.icmp_parameters import ICMPParameters -from stackit.iaasalpha.models.port_range import PortRange - - -class BaseSecurityGroupRule(BaseModel): - """ - The base schema for a security group rule. - """ - - description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( - default=None, description="Description Object. Allows string up to 255 Characters." - ) - direction: StrictStr = Field(description="The direction of the traffic which the rule should match.") - ethertype: Optional[StrictStr] = Field(default="IPv4", description="The ethertype which the rule should match.") - icmp_parameters: Optional[ICMPParameters] = Field(default=None, alias="icmpParameters") - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ip_range: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="The remote IP range which the rule should match.", alias="ipRange" - ) - port_range: Optional[PortRange] = Field(default=None, alias="portRange") - remote_security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, - description="The remote security group which the rule should match.", - alias="remoteSecurityGroupId", - ) - security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="securityGroupId" - ) - __properties: ClassVar[List[str]] = [ - "description", - "direction", - "ethertype", - "icmpParameters", - "id", - "ipRange", - "portRange", - "remoteSecurityGroupId", - "securityGroupId", - ] - - @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("ip_range") - def ip_range_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 - - @field_validator("remote_security_group_id") - def remote_security_group_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("security_group_id") - def security_group_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 BaseSecurityGroupRule 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", - "security_group_id", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of icmp_parameters - if self.icmp_parameters: - _dict["icmpParameters"] = self.icmp_parameters.to_dict() - # override the default output from pydantic by calling `to_dict()` of port_range - if self.port_range: - _dict["portRange"] = self.port_range.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BaseSecurityGroupRule from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "description": obj.get("description"), - "direction": obj.get("direction"), - "ethertype": obj.get("ethertype") if obj.get("ethertype") is not None else "IPv4", - "icmpParameters": ( - ICMPParameters.from_dict(obj["icmpParameters"]) if obj.get("icmpParameters") is not None else None - ), - "id": obj.get("id"), - "ipRange": obj.get("ipRange"), - "portRange": PortRange.from_dict(obj["portRange"]) if obj.get("portRange") is not None else None, - "remoteSecurityGroupId": obj.get("remoteSecurityGroupId"), - "securityGroupId": obj.get("securityGroupId"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/boot_volume.py b/services/iaasalpha/src/stackit/iaasalpha/models/boot_volume.py deleted file mode 100644 index 9801ab1a..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/boot_volume.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictInt, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.boot_volume_source import BootVolumeSource - - -class BootVolume(BaseModel): - """ - The boot device for the server. - """ - - delete_on_termination: Optional[StrictBool] = Field( - default=None, - description="Delete the volume during the termination of the server. Defaults to false.", - alias="deleteOnTermination", - ) - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - performance_class: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, - description="The name for a General Object. Matches Names and also UUIDs.", - alias="performanceClass", - ) - size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - source: Optional[BootVolumeSource] = None - __properties: ClassVar[List[str]] = ["deleteOnTermination", "id", "performanceClass", "size", "source"] - - @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("performance_class") - def performance_class_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 BootVolume 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. - """ - excluded_fields: Set[str] = set( - [ - "id", - ] - ) - - _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 BootVolume from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "deleteOnTermination": obj.get("deleteOnTermination"), - "id": obj.get("id"), - "performanceClass": obj.get("performanceClass"), - "size": obj.get("size"), - "source": BootVolumeSource.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_affinity_group_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_affinity_group_payload.py deleted file mode 100644 index e86a396d..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_affinity_group_payload.py +++ /dev/null @@ -1,122 +0,0 @@ -# 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. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`." - ) - __properties: ClassVar[List[str]] = ["id", "members", "name", "policy"] - - @field_validator("id") - 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_area_address_family.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_area_address_family.py deleted file mode 100644 index e89b23a4..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_area_address_family.py +++ /dev/null @@ -1,89 +0,0 @@ -# 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_area_ipv4 import CreateAreaIPv4 - - -class CreateAreaAddressFamily(BaseModel): - """ - The addressFamily object for a area create request. - """ - - ipv4: Optional[CreateAreaIPv4] = None - __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 CreateAreaAddressFamily 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() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateAreaAddressFamily from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"ipv4": CreateAreaIPv4.from_dict(obj["ipv4"]) if obj.get("ipv4") is not None else None} - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_area_ipv4.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_area_ipv4.py deleted file mode 100644 index 83f59ed7..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_area_ipv4.py +++ /dev/null @@ -1,156 +0,0 @@ -# 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.network_range import NetworkRange -from stackit.iaasalpha.models.route import Route - - -class CreateAreaIPv4(BaseModel): - """ - The config object for a IPv4 network area. - """ - - default_nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( - default=None, alias="defaultNameservers" - ) - network_ranges: Annotated[List[NetworkRange], Field(min_length=1, max_length=64)] = Field( - description="A list of network ranges.", alias="networkRanges" - ) - routes: Optional[List[Route]] = Field(default=None, description="A list of routes.") - transfer_network: Annotated[str, Field(strict=True)] = Field( - description="Classless Inter-Domain Routing (CIDR).", alias="transferNetwork" - ) - default_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( - default=None, - description="The default prefix length for networks in the network area.", - alias="defaultPrefixLen", - ) - max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( - default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" - ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( - default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" - ) - __properties: ClassVar[List[str]] = [ - "defaultNameservers", - "networkRanges", - "routes", - "transferNetwork", - "defaultPrefixLen", - "maxPrefixLen", - "minPrefixLen", - ] - - @field_validator("transfer_network") - def transfer_network_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match( - r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$", - value, - ): - raise ValueError( - r"must validate the regular expression /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/" - ) - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateAreaIPv4 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 network_ranges (list) - _items = [] - if self.network_ranges: - for _item in self.network_ranges: - if _item: - _items.append(_item.to_dict()) - _dict["networkRanges"] = _items - # override the default output from pydantic by calling `to_dict()` of each item in routes (list) - _items = [] - if self.routes: - for _item in self.routes: - if _item: - _items.append(_item.to_dict()) - _dict["routes"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateAreaIPv4 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "defaultNameservers": obj.get("defaultNameservers"), - "networkRanges": ( - [NetworkRange.from_dict(_item) for _item in obj["networkRanges"]] - if obj.get("networkRanges") is not None - else None - ), - "routes": ( - [Route.from_dict(_item) for _item in obj["routes"]] if obj.get("routes") is not None else None - ), - "transferNetwork": obj.get("transferNetwork"), - "defaultPrefixLen": obj.get("defaultPrefixLen"), - "maxPrefixLen": obj.get("maxPrefixLen"), - "minPrefixLen": obj.get("minPrefixLen"), - } - ) - 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 deleted file mode 100644 index a5d12ac8..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_backup_payload.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - 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 deleted file mode 100644 index c02e26be..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_image_payload.py +++ /dev/null @@ -1,219 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictInt, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.image_checksum import ImageChecksum -from stackit.iaasalpha.models.image_config import ImageConfig - - -class CreateImagePayload(BaseModel): - """ - Object that represents an Image and its parameters. Used for Creating and returning (get/list). - """ - - checksum: Optional[ImageChecksum] = None - config: Optional[ImageConfig] = None - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - disk_format: StrictStr = Field( - description="Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`.", alias="diskFormat" - ) - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") - min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") - 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. Possible values: `public`, `local`, `projects`, `organization`." - ) - size: Optional[StrictInt] = Field(default=None, description="Size in bytes.") - status: Optional[StrictStr] = Field( - default=None, - description="The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = [ - "checksum", - "config", - "createdAt", - "diskFormat", - "id", - "labels", - "minDiskSize", - "minRam", - "name", - "owner", - "protected", - "scope", - "size", - "status", - "updatedAt", - ] - - @field_validator("id") - def id_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): - raise ValueError( - r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" - ) - return value - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") - return value - - @field_validator("owner") - def owner_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): - raise ValueError( - r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" - ) - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateImagePayload from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - """ - excluded_fields: Set[str] = set( - [ - "checksum", - "created_at", - "id", - "owner", - "scope", - "size", - "status", - "updated_at", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of checksum - if self.checksum: - _dict["checksum"] = self.checksum.to_dict() - # override the default output from pydantic by calling `to_dict()` of config - if self.config: - _dict["config"] = self.config.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateImagePayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "checksum": ImageChecksum.from_dict(obj["checksum"]) if obj.get("checksum") is not None else None, - "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, - "createdAt": obj.get("createdAt"), - "diskFormat": obj.get("diskFormat"), - "id": obj.get("id"), - "labels": obj.get("labels"), - "minDiskSize": obj.get("minDiskSize"), - "minRam": obj.get("minRam"), - "name": obj.get("name"), - "owner": obj.get("owner"), - "protected": obj.get("protected"), - "scope": obj.get("scope"), - "size": obj.get("size"), - "status": obj.get("status"), - "updatedAt": obj.get("updatedAt"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_key_pair_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_key_pair_payload.py deleted file mode 100644 index 289c0fb8..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_key_pair_payload.py +++ /dev/null @@ -1,152 +0,0 @@ -# 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 CreateKeyPairPayload(BaseModel): - """ - Object that represents the public key of an SSH keypair and its name. - """ - - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - fingerprint: Optional[Annotated[str, Field(min_length=47, strict=True, max_length=47)]] = Field( - default=None, description="Object that represents an SSH keypair MD5 fingerprint." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( - default=None, - description="The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-].", - ) - public_key: Annotated[str, Field(strict=True)] = Field( - description="Object that represents a public SSH key.", alias="publicKey" - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = ["createdAt", "fingerprint", "labels", "name", "publicKey", "updatedAt"] - - @field_validator("fingerprint") - def fingerprint_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$", value): - raise ValueError(r"must validate the regular expression /^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$/") - 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@._-]*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9@._-]*$/") - return value - - @field_validator("public_key") - def public_key_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match( - r"^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$", value - ): - raise ValueError( - r"must validate the regular expression /^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\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 CreateKeyPairPayload 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. - """ - excluded_fields: Set[str] = set( - [ - "created_at", - "fingerprint", - "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 CreateKeyPairPayload 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"), - "fingerprint": obj.get("fingerprint"), - "labels": obj.get("labels"), - "name": obj.get("name"), - "publicKey": obj.get("publicKey"), - "updatedAt": obj.get("updatedAt"), - } - ) - return _obj 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 deleted file mode 100644 index c6b4c12b..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_address_family.py +++ /dev/null @@ -1,97 +0,0 @@ -# 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 deleted file mode 100644 index 8a5bd0e7..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_payload.py +++ /dev/null @@ -1,112 +0,0 @@ -# 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Annotated[str, Field(strict=True, max_length=63)] = Field( - description="The name for a General Object. Matches Names and also UUIDs." - ) - __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_route_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_route_payload.py deleted file mode 100644 index 59291039..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_route_payload.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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_server_payload_networking.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4.py similarity index 62% rename from services/iaasalpha/src/stackit/iaasalpha/models/create_server_payload_networking.py rename to services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4.py index a3c402c4..47975eaa 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_server_payload_networking.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -26,26 +26,28 @@ ) from typing_extensions import Self -from stackit.iaasalpha.models.create_server_networking import CreateServerNetworking -from stackit.iaasalpha.models.create_server_networking_with_nics import ( - CreateServerNetworkingWithNics, +from stackit.iaasalpha.models.create_network_ipv4_with_prefix import ( + CreateNetworkIPv4WithPrefix, +) +from stackit.iaasalpha.models.create_network_ipv4_with_prefix_length import ( + CreateNetworkIPv4WithPrefixLength, ) -CREATESERVERPAYLOADNETWORKING_ONE_OF_SCHEMAS = ["CreateServerNetworking", "CreateServerNetworkingWithNics"] +CREATENETWORKIPV4_ONE_OF_SCHEMAS = ["CreateNetworkIPv4WithPrefix", "CreateNetworkIPv4WithPrefixLength"] -class CreateServerPayloadNetworking(BaseModel): +class CreateNetworkIPv4(BaseModel): """ - The initial networking setup for the server creation. A network, a nic or nothing can be given. + The create request for an IPv4 network. """ - # data type: CreateServerNetworking - oneof_schema_1_validator: Optional[CreateServerNetworking] = None - # data type: CreateServerNetworkingWithNics - oneof_schema_2_validator: Optional[CreateServerNetworkingWithNics] = None - actual_instance: Optional[Union[CreateServerNetworking, CreateServerNetworkingWithNics]] = None - one_of_schemas: Set[str] = {"CreateServerNetworking", "CreateServerNetworkingWithNics"} + # data type: CreateNetworkIPv4WithPrefix + oneof_schema_1_validator: Optional[CreateNetworkIPv4WithPrefix] = None + # data type: CreateNetworkIPv4WithPrefixLength + oneof_schema_2_validator: Optional[CreateNetworkIPv4WithPrefixLength] = None + actual_instance: Optional[Union[CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength]] = None + one_of_schemas: Set[str] = {"CreateNetworkIPv4WithPrefix", "CreateNetworkIPv4WithPrefixLength"} model_config = ConfigDict( validate_assignment=True, @@ -64,23 +66,23 @@ def __init__(self, *args, **kwargs) -> None: @field_validator("actual_instance") def actual_instance_must_validate_oneof(cls, v): - instance = CreateServerPayloadNetworking.model_construct() + instance = CreateNetworkIPv4.model_construct() error_messages = [] match = 0 - # validate data type: CreateServerNetworking - if not isinstance(v, CreateServerNetworking): - error_messages.append(f"Error! Input type `{type(v)}` is not `CreateServerNetworking`") + # validate data type: CreateNetworkIPv4WithPrefix + if not isinstance(v, CreateNetworkIPv4WithPrefix): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateNetworkIPv4WithPrefix`") else: match += 1 - # validate data type: CreateServerNetworkingWithNics - if not isinstance(v, CreateServerNetworkingWithNics): - error_messages.append(f"Error! Input type `{type(v)}` is not `CreateServerNetworkingWithNics`") + # validate data type: CreateNetworkIPv4WithPrefixLength + if not isinstance(v, CreateNetworkIPv4WithPrefixLength): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateNetworkIPv4WithPrefixLength`") else: match += 1 if match == 0: # no match raise ValueError( - "No match found when setting `actual_instance` in CreateServerPayloadNetworking with oneOf schemas: CreateServerNetworking, CreateServerNetworkingWithNics. Details: " + "No match found when setting `actual_instance` in CreateNetworkIPv4 with oneOf schemas: CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength. Details: " + ", ".join(error_messages) ) else: @@ -97,15 +99,15 @@ def from_json(cls, json_str: str) -> Self: error_messages = [] match = 0 - # deserialize data into CreateServerNetworking + # deserialize data into CreateNetworkIPv4WithPrefix try: - instance.actual_instance = CreateServerNetworking.from_json(json_str) + instance.actual_instance = CreateNetworkIPv4WithPrefix.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into CreateServerNetworkingWithNics + # deserialize data into CreateNetworkIPv4WithPrefixLength try: - instance.actual_instance = CreateServerNetworkingWithNics.from_json(json_str) + instance.actual_instance = CreateNetworkIPv4WithPrefixLength.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) @@ -113,13 +115,13 @@ def from_json(cls, json_str: str) -> Self: if match > 1: # more than 1 match raise ValueError( - "Multiple matches found when deserializing the JSON string into CreateServerPayloadNetworking with oneOf schemas: CreateServerNetworking, CreateServerNetworkingWithNics. Details: " + "Multiple matches found when deserializing the JSON string into CreateNetworkIPv4 with oneOf schemas: CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength. Details: " + ", ".join(error_messages) ) elif match == 0: # no match raise ValueError( - "No match found when deserializing the JSON string into CreateServerPayloadNetworking with oneOf schemas: CreateServerNetworking, CreateServerNetworkingWithNics. Details: " + "No match found when deserializing the JSON string into CreateNetworkIPv4 with oneOf schemas: CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength. Details: " + ", ".join(error_messages) ) else: @@ -135,7 +137,9 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], CreateServerNetworking, CreateServerNetworkingWithNics]]: + def to_dict( + self, + ) -> Optional[Union[Dict[str, Any], CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None 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 deleted file mode 100644 index d3f3335e..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_body.py +++ /dev/null @@ -1,135 +0,0 @@ -# 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/add_member_to_virtual_ip_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_with_prefix.py similarity index 57% rename from services/iaasalpha/src/stackit/iaasalpha/models/add_member_to_virtual_ip_payload.py rename to services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_with_prefix.py index d16d26b9..3574b4bf 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/add_member_to_virtual_ip_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_with_prefix.py @@ -5,40 +5,45 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator from typing_extensions import Annotated, Self -class AddMemberToVirtualIPPayload(BaseModel): - """ - Object that represents a virtual IP member. +class CreateNetworkIPv4WithPrefix(BaseModel): """ + The create request for an IPv4 network with a specified prefix. + """ # noqa: E501 - member: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID)." + gateway: Optional[object] = None + 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]] = ["member"] + prefix: Annotated[str, Field(strict=True)] = Field(description="IPv4 Classless Inter-Domain Routing (CIDR).") + __properties: ClassVar[List[str]] = ["gateway", "nameservers", "prefix"] - @field_validator("member") - def member_validate_regular_expression(cls, value): + @field_validator("prefix") + def prefix_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): + 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]))$", + 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}$/" + 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]))$/" ) return value @@ -59,7 +64,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AddMemberToVirtualIPPayload from a JSON string""" + """Create an instance of CreateNetworkIPv4WithPrefix from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,16 +84,23 @@ def to_dict(self) -> Dict[str, Any]: 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 AddMemberToVirtualIPPayload from a dict""" + """Create an instance of CreateNetworkIPv4WithPrefix from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"member": obj.get("member")}) + _obj = cls.model_validate( + {"gateway": obj.get("gateway"), "nameservers": obj.get("nameservers"), "prefix": obj.get("prefix")} + ) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_server_networking_with_nics.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_with_prefix_length.py similarity index 69% rename from services/iaasalpha/src/stackit/iaasalpha/models/create_server_networking_with_nics.py rename to services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_with_prefix_length.py index 23ec7d14..32ace15a 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_server_networking_with_nics.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv4_with_prefix_length.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -22,15 +22,16 @@ from typing_extensions import Annotated, Self -class CreateServerNetworkingWithNics(BaseModel): - """ - The initial networking setup for the server creation with a network interface. +class CreateNetworkIPv4WithPrefixLength(BaseModel): """ + The create request for an IPv4 network with a wanted prefix length. + """ # noqa: E501 - nic_ids: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="A list of UUIDs.", alias="nicIds" + 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]] = ["nicIds"] + prefix_length: Annotated[int, Field(le=29, strict=True, ge=8)] = Field(alias="prefixLength") + __properties: ClassVar[List[str]] = ["nameservers", "prefixLength"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateServerNetworkingWithNics from a JSON string""" + """Create an instance of CreateNetworkIPv4WithPrefixLength from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,12 +74,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateServerNetworkingWithNics from a dict""" + """Create an instance of CreateNetworkIPv4WithPrefixLength from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"nicIds": obj.get("nicIds")}) + _obj = cls.model_validate({"nameservers": obj.get("nameservers"), "prefixLength": obj.get("prefixLength")}) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_protocol.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6.py similarity index 59% rename from services/iaasalpha/src/stackit/iaasalpha/models/create_protocol.py rename to services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6.py index d0c0a82f..0d901410 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_protocol.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -21,33 +21,33 @@ from pydantic import ( BaseModel, ConfigDict, - Field, - StrictStr, ValidationError, field_validator, ) -from typing_extensions import Annotated, Self +from typing_extensions import Self +from stackit.iaasalpha.models.create_network_ipv6_with_prefix import ( + CreateNetworkIPv6WithPrefix, +) +from stackit.iaasalpha.models.create_network_ipv6_with_prefix_length import ( + CreateNetworkIPv6WithPrefixLength, +) -CREATEPROTOCOL_ONE_OF_SCHEMAS = ["int", "str"] +CREATENETWORKIPV6_ONE_OF_SCHEMAS = ["CreateNetworkIPv6WithPrefix", "CreateNetworkIPv6WithPrefixLength"] -class CreateProtocol(BaseModel): + +class CreateNetworkIPv6(BaseModel): """ - The schema for a protocol when creating a security group rule. + The create request for an IPv6 network. """ - # data type: int - oneof_schema_1_validator: Optional[Annotated[int, Field(le=255, strict=True, ge=0)]] = Field( - default=None, description="The protocol number which the rule should match." - ) - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = Field( - default=None, - description="The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`.", - ) - actual_instance: Optional[Union[int, str]] = None - one_of_schemas: Set[str] = {"int", "str"} + # data type: CreateNetworkIPv6WithPrefix + oneof_schema_1_validator: Optional[CreateNetworkIPv6WithPrefix] = None + # data type: CreateNetworkIPv6WithPrefixLength + oneof_schema_2_validator: Optional[CreateNetworkIPv6WithPrefixLength] = None + actual_instance: Optional[Union[CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength]] = None + one_of_schemas: Set[str] = {"CreateNetworkIPv6WithPrefix", "CreateNetworkIPv6WithPrefixLength"} model_config = ConfigDict( validate_assignment=True, @@ -66,25 +66,23 @@ def __init__(self, *args, **kwargs) -> None: @field_validator("actual_instance") def actual_instance_must_validate_oneof(cls, v): - instance = CreateProtocol.model_construct() + instance = CreateNetworkIPv6.model_construct() error_messages = [] match = 0 - # validate data type: int - try: - instance.oneof_schema_1_validator = v + # validate data type: CreateNetworkIPv6WithPrefix + if not isinstance(v, CreateNetworkIPv6WithPrefix): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateNetworkIPv6WithPrefix`") + else: match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: str - try: - instance.oneof_schema_2_validator = v + # validate data type: CreateNetworkIPv6WithPrefixLength + if not isinstance(v, CreateNetworkIPv6WithPrefixLength): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateNetworkIPv6WithPrefixLength`") + else: match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) if match == 0: # no match raise ValueError( - "No match found when setting `actual_instance` in CreateProtocol with oneOf schemas: int, str. Details: " + "No match found when setting `actual_instance` in CreateNetworkIPv6 with oneOf schemas: CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength. Details: " + ", ".join(error_messages) ) else: @@ -101,21 +99,15 @@ def from_json(cls, json_str: str) -> Self: error_messages = [] match = 0 - # deserialize data into int + # deserialize data into CreateNetworkIPv6WithPrefix try: - # validation - instance.oneof_schema_1_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_1_validator + instance.actual_instance = CreateNetworkIPv6WithPrefix.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into str + # deserialize data into CreateNetworkIPv6WithPrefixLength try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator + instance.actual_instance = CreateNetworkIPv6WithPrefixLength.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) @@ -123,13 +115,13 @@ def from_json(cls, json_str: str) -> Self: if match > 1: # more than 1 match raise ValueError( - "Multiple matches found when deserializing the JSON string into CreateProtocol with oneOf schemas: int, str. Details: " + "Multiple matches found when deserializing the JSON string into CreateNetworkIPv6 with oneOf schemas: CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength. Details: " + ", ".join(error_messages) ) elif match == 0: # no match raise ValueError( - "No match found when deserializing the JSON string into CreateProtocol with oneOf schemas: int, str. Details: " + "No match found when deserializing the JSON string into CreateNetworkIPv6 with oneOf schemas: CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength. Details: " + ", ".join(error_messages) ) else: @@ -145,7 +137,9 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]: + def to_dict( + self, + ) -> Optional[Union[Dict[str, Any], CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_body.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_with_prefix.py similarity index 52% rename from services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_body.py rename to services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_with_prefix.py index 32197535..df20192d 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_body.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_with_prefix.py @@ -5,65 +5,39 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 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. +class CreateNetworkIPv6WithPrefix(BaseModel): """ + The create request for an IPv6 network with a specified prefix. + """ # noqa: E501 - 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.", - ) + gateway: Optional[object] = None 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 + prefix: Annotated[str, Field(strict=True)] = Field(description="Classless Inter-Domain Routing (CIDR) for IPv6.") + __properties: ClassVar[List[str]] = ["gateway", "nameservers", "prefix"] @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, @@ -90,7 +64,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateNetworkIPv6Body from a JSON string""" + """Create an instance of CreateNetworkIPv6WithPrefix from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -119,7 +93,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateNetworkIPv6Body from a dict""" + """Create an instance of CreateNetworkIPv6WithPrefix from a dict""" if obj is None: return None @@ -127,11 +101,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 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"), - } + {"gateway": obj.get("gateway"), "nameservers": obj.get("nameservers"), "prefix": obj.get("prefix")} ) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/icmp_parameters.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_with_prefix_length.py similarity index 69% rename from services/iaasalpha/src/stackit/iaasalpha/models/icmp_parameters.py rename to services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_with_prefix_length.py index 1886240d..5a65502f 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/icmp_parameters.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_ipv6_with_prefix_length.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -22,18 +22,16 @@ from typing_extensions import Annotated, Self -class ICMPParameters(BaseModel): - """ - Object that represents ICMP parameters. +class CreateNetworkIPv6WithPrefixLength(BaseModel): """ + The create request for an IPv6 network with a wanted prefix length. + """ # noqa: E501 - code: Annotated[int, Field(le=255, strict=True, ge=0)] = Field( - description="ICMP code. Can be set if the protocol is ICMP." - ) - type: Annotated[int, Field(le=255, strict=True, ge=0)] = Field( - description="ICMP type. Can be set if the protocol is ICMP." + 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]] = ["code", "type"] + prefix_length: Annotated[int, Field(le=128, strict=True, ge=56)] = Field(alias="prefixLength") + __properties: ClassVar[List[str]] = ["nameservers", "prefixLength"] model_config = ConfigDict( populate_by_name=True, @@ -52,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ICMPParameters from a JSON string""" + """Create an instance of CreateNetworkIPv6WithPrefixLength from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -76,12 +74,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ICMPParameters from a dict""" + """Create an instance of CreateNetworkIPv6WithPrefixLength from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"code": obj.get("code"), "type": obj.get("type")}) + _obj = cls.model_validate({"nameservers": obj.get("nameservers"), "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 index 1b3d7af9..308bd9fd 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/create_network_payload.py @@ -5,51 +5,66 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 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, -) +from stackit.iaasalpha.models.create_network_ipv4 import CreateNetworkIPv4 +from stackit.iaasalpha.models.create_network_ipv6 import CreateNetworkIPv6 class CreateNetworkPayload(BaseModel): """ Object that represents the request body for a network create. - """ + """ # noqa: E501 - address_family: Optional[CreateNetworkAddressFamily] = Field(default=None, alias="addressFamily") + ipv4: Optional[CreateNetworkIPv4] = None + ipv6: Optional[CreateNetworkIPv6] = None labels: Optional[Dict[str, Any]] = Field( default=None, description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) - name: Annotated[str, Field(strict=True, max_length=63)] = Field( + name: Annotated[str, Field(strict=True, max_length=127)] = 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"] + routing_table_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="routingTableId" + ) + __properties: ClassVar[List[str]] = ["ipv4", "ipv6", "labels", "name", "routed", "routingTableId"] @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]+)*$/") + if not re.match(r"^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$/") + return value + + @field_validator("routing_table_id") + def routing_table_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( @@ -89,9 +104,12 @@ def to_dict(self) -> Dict[str, Any]: 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() + # 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 @@ -105,14 +123,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "addressFamily": ( - CreateNetworkAddressFamily.from_dict(obj["addressFamily"]) - if obj.get("addressFamily") is not None - else None - ), + "ipv4": CreateNetworkIPv4.from_dict(obj["ipv4"]) if obj.get("ipv4") is not None else None, + "ipv6": CreateNetworkIPv6.from_dict(obj["ipv6"]) if obj.get("ipv6") is not None else None, "labels": obj.get("labels"), "name": obj.get("name"), "routed": obj.get("routed"), + "routingTableId": obj.get("routingTableId"), } ) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_nic_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_nic_payload.py deleted file mode 100644 index 318601c4..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_nic_payload.py +++ /dev/null @@ -1,271 +0,0 @@ -# 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, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.allowed_addresses_inner import AllowedAddressesInner - - -class CreateNicPayload(BaseModel): - """ - Object that represents a network interface. - """ - - allowed_addresses: Optional[List[AllowedAddressesInner]] = Field( - default=None, description="A list of IPs or CIDR notations.", alias="allowedAddresses" - ) - device: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ipv4: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - ipv6: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="String that represents an IPv6 address." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - mac: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an MAC address." - ) - 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." - ) - network_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="networkId" - ) - nic_security: Optional[StrictBool] = Field( - default=None, - description="If this is set to false, then no security groups will apply to this network interface.", - alias="nicSecurity", - ) - security_groups: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="A list of UUIDs.", alias="securityGroups" - ) - status: Optional[StrictStr] = None - type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "allowedAddresses", - "device", - "id", - "ipv4", - "ipv6", - "labels", - "mac", - "name", - "networkId", - "nicSecurity", - "securityGroups", - "status", - "type", - ] - - @field_validator("device") - def device_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("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("ipv4") - def ipv4_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("ipv6") - def ipv6_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match( - r"^\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-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("mac") - def mac_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$", value): - raise ValueError(r"must validate the regular expression /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/") - 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("network_id") - def network_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 CreateNicPayload 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. - """ - excluded_fields: Set[str] = set( - [ - "device", - "id", - "mac", - "network_id", - "status", - "type", - ] - ) - - _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 allowed_addresses (list) - _items = [] - if self.allowed_addresses: - for _item in self.allowed_addresses: - if _item: - _items.append(_item.to_dict()) - _dict["allowedAddresses"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateNicPayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "allowedAddresses": ( - [AllowedAddressesInner.from_dict(_item) for _item in obj["allowedAddresses"]] - if obj.get("allowedAddresses") is not None - else None - ), - "device": obj.get("device"), - "id": obj.get("id"), - "ipv4": obj.get("ipv4"), - "ipv6": obj.get("ipv6"), - "labels": obj.get("labels"), - "mac": obj.get("mac"), - "name": obj.get("name"), - "networkId": obj.get("networkId"), - "nicSecurity": obj.get("nicSecurity"), - "securityGroups": obj.get("securityGroups"), - "status": obj.get("status"), - "type": obj.get("type"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_public_ip_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_public_ip_payload.py deleted file mode 100644 index c9b0ee0e..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_public_ip_payload.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 CreatePublicIPPayload(BaseModel): - """ - Object that represents a public IP. - """ - - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ip: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, - description="Associate the public IP with a network interface or a virtual IP (ID).", - alias="networkInterface", - ) - __properties: ClassVar[List[str]] = ["id", "ip", "labels", "networkInterface"] - - @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("ip") - def ip_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("network_interface") - def network_interface_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 CreatePublicIPPayload 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", - "ip", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if network_interface (nullable) is None - # and model_fields_set contains the field - if self.network_interface is None and "network_interface" in self.model_fields_set: - _dict["networkInterface"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreatePublicIPPayload 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"), - "ip": obj.get("ip"), - "labels": obj.get("labels"), - "networkInterface": obj.get("networkInterface"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_rule_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_rule_payload.py deleted file mode 100644 index a0115a3b..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_rule_payload.py +++ /dev/null @@ -1,201 +0,0 @@ -# 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 - -from stackit.iaasalpha.models.create_protocol import CreateProtocol -from stackit.iaasalpha.models.icmp_parameters import ICMPParameters -from stackit.iaasalpha.models.port_range import PortRange - - -class CreateSecurityGroupRulePayload(BaseModel): - """ - Object that represents a request body for security group rule creation. - """ - - description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( - default=None, description="Description Object. Allows string up to 255 Characters." - ) - direction: StrictStr = Field(description="The direction of the traffic which the rule should match.") - ethertype: Optional[StrictStr] = Field(default="IPv4", description="The ethertype which the rule should match.") - icmp_parameters: Optional[ICMPParameters] = Field(default=None, alias="icmpParameters") - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ip_range: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="The remote IP range which the rule should match.", alias="ipRange" - ) - port_range: Optional[PortRange] = Field(default=None, alias="portRange") - remote_security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, - description="The remote security group which the rule should match.", - alias="remoteSecurityGroupId", - ) - security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="securityGroupId" - ) - protocol: Optional[CreateProtocol] = None - __properties: ClassVar[List[str]] = [ - "description", - "direction", - "ethertype", - "icmpParameters", - "id", - "ipRange", - "portRange", - "remoteSecurityGroupId", - "securityGroupId", - "protocol", - ] - - @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("ip_range") - def ip_range_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 - - @field_validator("remote_security_group_id") - def remote_security_group_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("security_group_id") - def security_group_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 CreateSecurityGroupRulePayload 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", - "security_group_id", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of icmp_parameters - if self.icmp_parameters: - _dict["icmpParameters"] = self.icmp_parameters.to_dict() - # override the default output from pydantic by calling `to_dict()` of port_range - if self.port_range: - _dict["portRange"] = self.port_range.to_dict() - # override the default output from pydantic by calling `to_dict()` of protocol - if self.protocol: - _dict["protocol"] = self.protocol.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateSecurityGroupRulePayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "description": obj.get("description"), - "direction": obj.get("direction"), - "ethertype": obj.get("ethertype") if obj.get("ethertype") is not None else "IPv4", - "icmpParameters": ( - ICMPParameters.from_dict(obj["icmpParameters"]) if obj.get("icmpParameters") is not None else None - ), - "id": obj.get("id"), - "ipRange": obj.get("ipRange"), - "portRange": PortRange.from_dict(obj["portRange"]) if obj.get("portRange") is not None else None, - "remoteSecurityGroupId": obj.get("remoteSecurityGroupId"), - "securityGroupId": obj.get("securityGroupId"), - "protocol": CreateProtocol.from_dict(obj["protocol"]) if obj.get("protocol") is not None else None, - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_rule_protocol.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_rule_protocol.py deleted file mode 100644 index 97846714..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_rule_protocol.py +++ /dev/null @@ -1,89 +0,0 @@ -# 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_protocol import CreateProtocol - - -class CreateSecurityGroupRuleProtocol(BaseModel): - """ - The internet protocol which the rule should match. - """ - - protocol: Optional[CreateProtocol] = None - __properties: ClassVar[List[str]] = ["protocol"] - - 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 CreateSecurityGroupRuleProtocol 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 protocol - if self.protocol: - _dict["protocol"] = self.protocol.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateSecurityGroupRuleProtocol from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"protocol": CreateProtocol.from_dict(obj["protocol"]) if obj.get("protocol") is not None else None} - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_server_networking.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_server_networking.py deleted file mode 100644 index 9a44fecc..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_server_networking.py +++ /dev/null @@ -1,97 +0,0 @@ -# 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 CreateServerNetworking(BaseModel): - """ - The initial networking setup for the server creation with a network. - """ - - network_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="networkId" - ) - __properties: ClassVar[List[str]] = ["networkId"] - - @field_validator("network_id") - def network_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 CreateServerNetworking 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 CreateServerNetworking from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"networkId": obj.get("networkId")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_server_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_server_payload.py deleted file mode 100644 index 40dad5db..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_server_payload.py +++ /dev/null @@ -1,321 +0,0 @@ -# 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, Union - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBytes, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.boot_volume import BootVolume -from stackit.iaasalpha.models.create_server_payload_networking import ( - CreateServerPayloadNetworking, -) -from stackit.iaasalpha.models.server_maintenance import ServerMaintenance -from stackit.iaasalpha.models.server_network import ServerNetwork - - -class CreateServerPayload(BaseModel): - """ - Representation of a single server object. - """ - - affinity_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="The affinity group the server is assigned to.", alias="affinityGroup" - ) - availability_zone: Optional[StrictStr] = Field( - default=None, - description="This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone.", - alias="availabilityZone", - ) - boot_volume: Optional[BootVolume] = Field(default=None, alias="bootVolume") - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - error_message: Optional[StrictStr] = Field(default=None, description="An error message.", alias="errorMessage") - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - image_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="imageId" - ) - keypair_name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( - default=None, description="The SSH keypair used during the server creation.", alias="keypairName" - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - launched_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was launched.", alias="launchedAt" - ) - machine_type: Annotated[str, Field(strict=True, max_length=63)] = Field( - description="Name of the machine type the server shall belong to.", alias="machineType" - ) - maintenance_window: Optional[ServerMaintenance] = Field(default=None, alias="maintenanceWindow") - name: Annotated[str, Field(strict=True, max_length=63)] = Field(description="The name for a Server.") - networking: Optional[CreateServerPayloadNetworking] = None - nics: Optional[List[ServerNetwork]] = Field( - default=None, - description="The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested.", - ) - power_status: Optional[StrictStr] = Field( - default=None, - description="The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`.", - alias="powerStatus", - ) - security_groups: Optional[List[Annotated[str, Field(strict=True, max_length=63)]]] = Field( - default=None, description="The initial security groups for the server creation.", alias="securityGroups" - ) - service_account_mails: Optional[ - Annotated[List[Annotated[str, Field(strict=True, max_length=255)]], Field(max_length=1)] - ] = Field( - default=None, - description="A list of service account mails. Only shown when detailed information is requested.", - alias="serviceAccountMails", - ) - status: Optional[StrictStr] = Field( - default=None, - description="The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - user_data: Optional[Union[StrictBytes, StrictStr]] = Field( - default=None, - description="User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested.", - alias="userData", - ) - volumes: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="The list of volumes attached to the server." - ) - __properties: ClassVar[List[str]] = [ - "affinityGroup", - "availabilityZone", - "bootVolume", - "createdAt", - "errorMessage", - "id", - "imageId", - "keypairName", - "labels", - "launchedAt", - "machineType", - "maintenanceWindow", - "name", - "networking", - "nics", - "powerStatus", - "securityGroups", - "serviceAccountMails", - "status", - "updatedAt", - "userData", - "volumes", - ] - - @field_validator("affinity_group") - def affinity_group_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("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("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 - - @field_validator("keypair_name") - def keypair_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@._-]*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9@._-]*$/") - return value - - @field_validator("machine_type") - def machine_type_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") - return value - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+((-|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|\.)[A-Za-z0-9]+)*$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateServerPayload 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. - * OpenAPI `readOnly` fields are excluded. - """ - excluded_fields: Set[str] = set( - [ - "created_at", - "error_message", - "id", - "launched_at", - "maintenance_window", - "nics", - "power_status", - "status", - "updated_at", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of boot_volume - if self.boot_volume: - _dict["bootVolume"] = self.boot_volume.to_dict() - # override the default output from pydantic by calling `to_dict()` of maintenance_window - if self.maintenance_window: - _dict["maintenanceWindow"] = self.maintenance_window.to_dict() - # override the default output from pydantic by calling `to_dict()` of networking - if self.networking: - _dict["networking"] = self.networking.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in nics (list) - _items = [] - if self.nics: - for _item in self.nics: - if _item: - _items.append(_item.to_dict()) - _dict["nics"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateServerPayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "affinityGroup": obj.get("affinityGroup"), - "availabilityZone": obj.get("availabilityZone"), - "bootVolume": BootVolume.from_dict(obj["bootVolume"]) if obj.get("bootVolume") is not None else None, - "createdAt": obj.get("createdAt"), - "errorMessage": obj.get("errorMessage"), - "id": obj.get("id"), - "imageId": obj.get("imageId"), - "keypairName": obj.get("keypairName"), - "labels": obj.get("labels"), - "launchedAt": obj.get("launchedAt"), - "machineType": obj.get("machineType"), - "maintenanceWindow": ( - ServerMaintenance.from_dict(obj["maintenanceWindow"]) - if obj.get("maintenanceWindow") is not None - else None - ), - "name": obj.get("name"), - "networking": ( - CreateServerPayloadNetworking.from_dict(obj["networking"]) - if obj.get("networking") is not None - else None - ), - "nics": ( - [ServerNetwork.from_dict(_item) for _item in obj["nics"]] if obj.get("nics") is not None else None - ), - "powerStatus": obj.get("powerStatus"), - "securityGroups": obj.get("securityGroups"), - "serviceAccountMails": obj.get("serviceAccountMails"), - "status": obj.get("status"), - "updatedAt": obj.get("updatedAt"), - "userData": obj.get("userData"), - "volumes": obj.get("volumes"), - } - ) - 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 deleted file mode 100644 index 1535da3e..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_snapshot_payload.py +++ /dev/null @@ -1,162 +0,0 @@ -# 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - status: Optional[StrictStr] = Field( - default=None, - description="The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - 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_virtual_ip_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/create_virtual_ip_payload.py deleted file mode 100644 index 54a061fd..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_virtual_ip_payload.py +++ /dev/null @@ -1,173 +0,0 @@ -# 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 CreateVirtualIPPayload(BaseModel): - """ - Object that represents a virtual IP. - """ - - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ip: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - members: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="A list of UUIDs." - ) - 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." - ) - network: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - status: Optional[StrictStr] = Field( - default=None, - description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`.", - ) - __properties: ClassVar[List[str]] = ["id", "ip", "labels", "members", "name", "network", "status"] - - @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("ip") - def ip_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("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("network") - def network_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 CreateVirtualIPPayload 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. - """ - excluded_fields: Set[str] = set( - [ - "id", - "network", - "status", - ] - ) - - _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 CreateVirtualIPPayload 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"), - "ip": obj.get("ip"), - "labels": obj.get("labels"), - "members": obj.get("members"), - "name": obj.get("name"), - "network": obj.get("network"), - "status": obj.get("status"), - } - ) - 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 deleted file mode 100644 index 54efef2c..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_volume_payload.py +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictInt, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.image_config import ImageConfig -from stackit.iaasalpha.models.volume_source import VolumeSource - - -class CreateVolumePayload(BaseModel): - """ - Object that represents a volume and its parameters. Used for Creating and returning (get/list). - """ - - availability_zone: StrictStr = Field( - description="Object that represents an availability zone.", alias="availabilityZone" - ) - bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( - default=None, description="Description Object. Allows string up to 255 Characters." - ) - 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - performance_class: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, - description="The name for a General Object. Matches Names and also UUIDs.", - alias="performanceClass", - ) - server_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="serverId" - ) - size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - source: Optional[VolumeSource] = None - status: Optional[StrictStr] = Field( - default=None, - description="The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = [ - "availabilityZone", - "bootable", - "createdAt", - "description", - "id", - "imageConfig", - "labels", - "name", - "performanceClass", - "serverId", - "size", - "source", - "status", - "updatedAt", - ] - - @field_validator("id") - def id_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): - raise ValueError( - r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" - ) - return value - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if 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("performance_class") - def performance_class_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("server_id") - def server_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 CreateVolumePayload 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. - """ - excluded_fields: Set[str] = set( - [ - "created_at", - "id", - "image_config", - "server_id", - "status", - "updated_at", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of 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() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateVolumePayload 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"), - "bootable": obj.get("bootable"), - "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"), - "serverId": obj.get("serverId"), - "size": obj.get("size"), - "source": VolumeSource.from_dict(obj["source"]) if obj.get("source") is not None else None, - "status": obj.get("status"), - "updatedAt": obj.get("updatedAt"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/boot_volume_source.py b/services/iaasalpha/src/stackit/iaasalpha/models/destination_cidrv4.py similarity index 67% rename from services/iaasalpha/src/stackit/iaasalpha/models/boot_volume_source.py rename to services/iaasalpha/src/stackit/iaasalpha/models/destination_cidrv4.py index aa4a3473..54c19ca6 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/boot_volume_source.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/destination_cidrv4.py @@ -5,41 +5,42 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 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 BootVolumeSource(BaseModel): - """ - The source object of a boot volume. +class DestinationCIDRv4(BaseModel): """ + IPv4 Classless Inter-Domain Routing (CIDR) Object. + """ # noqa: E501 - id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID)." - ) - type: StrictStr = Field(description="The source types of a boot volume. Possible values: `image`, `volume`.") - __properties: ClassVar[List[str]] = ["id", "type"] + type: StrictStr + value: Annotated[str, Field(strict=True)] = Field(description="An CIDRv4 string.") + __properties: ClassVar[List[str]] = ["type", "value"] - @field_validator("id") - def id_validate_regular_expression(cls, value): + @field_validator("value") + def value_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): + 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]))$", + 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}$/" + 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]))$/" ) return value @@ -60,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BootVolumeSource from a JSON string""" + """Create an instance of DestinationCIDRv4 from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,12 +85,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BootVolumeSource from a dict""" + """Create an instance of DestinationCIDRv4 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")}) + _obj = cls.model_validate({"type": obj.get("type"), "value": obj.get("value")}) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/destination_cidrv6.py b/services/iaasalpha/src/stackit/iaasalpha/models/destination_cidrv6.py new file mode 100644 index 00000000..93eb3d34 --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/destination_cidrv6.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 2alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class DestinationCIDRv6(BaseModel): + """ + IPv6 Classless Inter-Domain Routing (CIDR) Object. + """ # noqa: E501 + + type: StrictStr + value: Annotated[str, Field(strict=True)] = Field(description="An CIDRv6 string.") + __properties: ClassVar[List[str]] = ["type", "value"] + + @field_validator("value") + def value_validate_regular_expression(cls, value): + """Validates the regular expression""" + 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 DestinationCIDRv6 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 DestinationCIDRv6 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"type": obj.get("type"), "value": obj.get("value")}) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/error.py b/services/iaasalpha/src/stackit/iaasalpha/models/error.py index 016f64cf..024d705b 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/error.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/error.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Error(BaseModel): """ Error with HTTP error code and an error message. - """ + """ # noqa: E501 code: StrictInt msg: StrictStr = Field(description="An error message.") diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image.py b/services/iaasalpha/src/stackit/iaasalpha/models/image.py deleted file mode 100644 index 13649501..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/image.py +++ /dev/null @@ -1,219 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictInt, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.image_checksum import ImageChecksum -from stackit.iaasalpha.models.image_config import ImageConfig - - -class Image(BaseModel): - """ - Object that represents an Image and its parameters. Used for Creating and returning (get/list). - """ - - checksum: Optional[ImageChecksum] = None - config: Optional[ImageConfig] = None - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - disk_format: StrictStr = Field( - description="Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`.", alias="diskFormat" - ) - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") - min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") - 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. Possible values: `public`, `local`, `projects`, `organization`." - ) - size: Optional[StrictInt] = Field(default=None, description="Size in bytes.") - status: Optional[StrictStr] = Field( - default=None, - description="The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = [ - "checksum", - "config", - "createdAt", - "diskFormat", - "id", - "labels", - "minDiskSize", - "minRam", - "name", - "owner", - "protected", - "scope", - "size", - "status", - "updatedAt", - ] - - @field_validator("id") - def id_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): - raise ValueError( - r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" - ) - return value - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") - return value - - @field_validator("owner") - def owner_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): - raise ValueError( - r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" - ) - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Image from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - """ - excluded_fields: Set[str] = set( - [ - "checksum", - "created_at", - "id", - "owner", - "scope", - "size", - "status", - "updated_at", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of checksum - if self.checksum: - _dict["checksum"] = self.checksum.to_dict() - # override the default output from pydantic by calling `to_dict()` of config - if self.config: - _dict["config"] = self.config.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Image from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "checksum": ImageChecksum.from_dict(obj["checksum"]) if obj.get("checksum") is not None else None, - "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, - "createdAt": obj.get("createdAt"), - "diskFormat": obj.get("diskFormat"), - "id": obj.get("id"), - "labels": obj.get("labels"), - "minDiskSize": obj.get("minDiskSize"), - "minRam": obj.get("minRam"), - "name": obj.get("name"), - "owner": obj.get("owner"), - "protected": obj.get("protected"), - "scope": obj.get("scope"), - "size": obj.get("size"), - "status": obj.get("status"), - "updatedAt": obj.get("updatedAt"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_checksum.py b/services/iaasalpha/src/stackit/iaasalpha/models/image_checksum.py deleted file mode 100644 index 7f6362a3..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/image_checksum.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 ImageChecksum(BaseModel): - """ - Representation of an image checksum. - """ - - algorithm: StrictStr = Field(description="Algorithm for the checksum of the image data.") - digest: Annotated[str, Field(strict=True)] = Field(description="Hexdigest of the checksum of the image data.") - __properties: ClassVar[List[str]] = ["algorithm", "digest"] - - @field_validator("digest") - def digest_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[0-9a-f]+$", value): - raise ValueError(r"must validate the regular expression /^[0-9a-f]+$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ImageChecksum from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ImageChecksum from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"algorithm": obj.get("algorithm"), "digest": obj.get("digest")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_config.py b/services/iaasalpha/src/stackit/iaasalpha/models/image_config.py deleted file mode 100644 index e6045157..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/image_config.py +++ /dev/null @@ -1,191 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing_extensions import Self - - -class ImageConfig(BaseModel): - """ - Properties to set hardware and scheduling settings for an Image. - """ - - architecture: Optional[StrictStr] = Field( - default=None, description="Represents CPU architecture. The default for new images is x86." - ) - boot_menu: Optional[StrictBool] = Field( - default=None, description="Enables the BIOS bootmenu. The default for new images is disabled.", alias="bootMenu" - ) - cdrom_bus: Optional[StrictStr] = Field( - default=None, description="Sets CDROM bus controller type.", alias="cdromBus" - ) - disk_bus: Optional[StrictStr] = Field(default=None, description="Sets Disk bus controller type.", alias="diskBus") - nic_model: Optional[StrictStr] = Field(default=None, description="Sets virtual nic model.", alias="nicModel") - operating_system: Optional[StrictStr] = Field( - default=None, description="Enables OS specific optimizations.", alias="operatingSystem" - ) - operating_system_distro: Optional[StrictStr] = Field( - default=None, description="Operating System Distribution.", alias="operatingSystemDistro" - ) - operating_system_version: Optional[StrictStr] = Field( - default=None, description="Version of the OS.", alias="operatingSystemVersion" - ) - rescue_bus: Optional[StrictStr] = Field( - default=None, description="Sets the device bus when the image is used as a rescue image.", alias="rescueBus" - ) - rescue_device: Optional[StrictStr] = Field( - default=None, description="Sets the device when the image is used as a rescue image.", alias="rescueDevice" - ) - secure_boot: Optional[StrictBool] = Field( - default=None, description="Enables Secure Boot. The default for new images is disabled.", alias="secureBoot" - ) - uefi: Optional[StrictBool] = Field( - default=None, description="Configure UEFI boot. The default for new images is enabled." - ) - video_model: Optional[StrictStr] = Field(default=None, description="Sets Graphic device model.", alias="videoModel") - virtio_scsi: Optional[StrictBool] = Field( - default=None, - description="Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO Block.", - alias="virtioScsi", - ) - __properties: ClassVar[List[str]] = [ - "architecture", - "bootMenu", - "cdromBus", - "diskBus", - "nicModel", - "operatingSystem", - "operatingSystemDistro", - "operatingSystemVersion", - "rescueBus", - "rescueDevice", - "secureBoot", - "uefi", - "videoModel", - "virtioScsi", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ImageConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if cdrom_bus (nullable) is None - # and model_fields_set contains the field - if self.cdrom_bus is None and "cdrom_bus" in self.model_fields_set: - _dict["cdromBus"] = None - - # set to None if disk_bus (nullable) is None - # and model_fields_set contains the field - if self.disk_bus is None and "disk_bus" in self.model_fields_set: - _dict["diskBus"] = None - - # set to None if nic_model (nullable) is None - # and model_fields_set contains the field - if self.nic_model is None and "nic_model" in self.model_fields_set: - _dict["nicModel"] = None - - # set to None if operating_system_distro (nullable) is None - # and model_fields_set contains the field - if self.operating_system_distro is None and "operating_system_distro" in self.model_fields_set: - _dict["operatingSystemDistro"] = None - - # set to None if operating_system_version (nullable) is None - # and model_fields_set contains the field - if self.operating_system_version is None and "operating_system_version" in self.model_fields_set: - _dict["operatingSystemVersion"] = None - - # set to None if rescue_bus (nullable) is None - # and model_fields_set contains the field - if self.rescue_bus is None and "rescue_bus" in self.model_fields_set: - _dict["rescueBus"] = None - - # set to None if rescue_device (nullable) is None - # and model_fields_set contains the field - if self.rescue_device is None and "rescue_device" in self.model_fields_set: - _dict["rescueDevice"] = None - - # set to None if video_model (nullable) is None - # and model_fields_set contains the field - if self.video_model is None and "video_model" in self.model_fields_set: - _dict["videoModel"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ImageConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "architecture": obj.get("architecture"), - "bootMenu": obj.get("bootMenu"), - "cdromBus": obj.get("cdromBus"), - "diskBus": obj.get("diskBus"), - "nicModel": obj.get("nicModel"), - "operatingSystem": obj.get("operatingSystem"), - "operatingSystemDistro": obj.get("operatingSystemDistro"), - "operatingSystemVersion": obj.get("operatingSystemVersion"), - "rescueBus": obj.get("rescueBus"), - "rescueDevice": obj.get("rescueDevice"), - "secureBoot": obj.get("secureBoot"), - "uefi": obj.get("uefi"), - "videoModel": obj.get("videoModel"), - "virtioScsi": obj.get("virtioScsi"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_share.py b/services/iaasalpha/src/stackit/iaasalpha/models/image_share.py deleted file mode 100644 index 982493ad..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/image_share.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 deleted file mode 100644 index 6f667cfd..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/image_share_consumer.py +++ /dev/null @@ -1,137 +0,0 @@ -# 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/key_pair_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/key_pair_list_response.py deleted file mode 100644 index c745ad96..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/key_pair_list_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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.keypair import Keypair - - -class KeyPairListResponse(BaseModel): - """ - SSH keypair list response. - """ - - items: List[Keypair] = Field(description="A list of SSH keypairs.") - __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 KeyPairListResponse 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 KeyPairListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"items": [Keypair.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/keypair.py b/services/iaasalpha/src/stackit/iaasalpha/models/keypair.py deleted file mode 100644 index 3c65d8df..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/keypair.py +++ /dev/null @@ -1,152 +0,0 @@ -# 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 Keypair(BaseModel): - """ - Object that represents the public key of an SSH keypair and its name. - """ - - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - fingerprint: Optional[Annotated[str, Field(min_length=47, strict=True, max_length=47)]] = Field( - default=None, description="Object that represents an SSH keypair MD5 fingerprint." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( - default=None, - description="The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-].", - ) - public_key: Annotated[str, Field(strict=True)] = Field( - description="Object that represents a public SSH key.", alias="publicKey" - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = ["createdAt", "fingerprint", "labels", "name", "publicKey", "updatedAt"] - - @field_validator("fingerprint") - def fingerprint_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$", value): - raise ValueError(r"must validate the regular expression /^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$/") - 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@._-]*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9@._-]*$/") - return value - - @field_validator("public_key") - def public_key_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match( - r"^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\s*$", value - ): - raise ValueError( - r"must validate the regular expression /^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+\/]+[=]{0,3}(\s+.+)?\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 Keypair 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. - """ - excluded_fields: Set[str] = set( - [ - "created_at", - "fingerprint", - "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 Keypair 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"), - "fingerprint": obj.get("fingerprint"), - "labels": obj.get("labels"), - "name": obj.get("name"), - "publicKey": obj.get("publicKey"), - "updatedAt": obj.get("updatedAt"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/machine_type.py b/services/iaasalpha/src/stackit/iaasalpha/models/machine_type.py deleted file mode 100644 index 07733ecd..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/machine_type.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator -from typing_extensions import Annotated, Self - - -class MachineType(BaseModel): - """ - Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, `ram`, `vcpus`. - """ - - description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( - default=None, description="Description Object. Allows string up to 255 Characters." - ) - disk: StrictInt = Field(description="Size in Gigabyte.") - extra_specs: Optional[Dict[str, Any]] = Field( - default=None, - description="Properties to control certain aspects or scheduling behavior for an object.", - alias="extraSpecs", - ) - name: Annotated[str, Field(strict=True, max_length=63)] = Field( - description="The name for a General Object. Matches Names and also UUIDs." - ) - ram: StrictInt = Field(description="Size in Megabyte.") - vcpus: Annotated[int, Field(strict=True, ge=1)] = Field(description="The number of virtual CPUs of a server.") - __properties: ClassVar[List[str]] = ["description", "disk", "extraSpecs", "name", "ram", "vcpus"] - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MachineType from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MachineType from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "description": obj.get("description"), - "disk": obj.get("disk"), - "extraSpecs": obj.get("extraSpecs"), - "name": obj.get("name"), - "ram": obj.get("ram"), - "vcpus": obj.get("vcpus"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/network.py b/services/iaasalpha/src/stackit/iaasalpha/models/network.py index 37c8df58..0485be19 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/network.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/network.py @@ -5,18 +5,18 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -30,46 +30,35 @@ ) from typing_extensions import Annotated, Self +from stackit.iaasalpha.models.network_ipv4 import NetworkIPv4 +from stackit.iaasalpha.models.network_ipv6 import NetworkIPv6 + class Network(BaseModel): """ Object that represents a network. - """ + """ # noqa: E501 created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) - 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.", - ) - gatewayv6: 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.", + id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="Universally Unique Identifier (UUID)." ) + ipv4: Optional[NetworkIPv4] = None + ipv6: Optional[NetworkIPv6] = None labels: Optional[Dict[str, Any]] = Field( default=None, description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) - name: Annotated[str, Field(strict=True, max_length=255)] - 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." - ) - nameservers_v6: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( - default=None, description="A list containing DNS Servers/Nameservers for IPv6.", alias="nameserversV6" - ) - network_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID).", alias="networkId" - ) - prefixes: Optional[List[Annotated[str, Field(strict=True)]]] = None - prefixes_v6: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, alias="prefixesV6") - public_ip: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address.", alias="publicIp" - ) + name: StrictStr routed: Optional[StrictBool] = Field( default=None, description="Shows if the network is routed and therefore accessible from other networks." ) - state: StrictStr = Field( + routing_table_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="routingTableId" + ) + status: StrictStr = Field( description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." ) updated_at: Optional[datetime] = Field( @@ -77,53 +66,19 @@ class Network(BaseModel): ) __properties: ClassVar[List[str]] = [ "createdAt", - "gateway", - "gatewayv6", + "id", + "ipv4", + "ipv6", "labels", "name", - "nameservers", - "nameserversV6", - "networkId", - "prefixes", - "prefixesV6", - "publicIp", "routed", - "state", + "routingTableId", + "status", "updatedAt", ] - @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("gatewayv6") - def gatewayv6_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("network_id") - def network_id_validate_regular_expression(cls, value): + @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( @@ -131,18 +86,15 @@ def network_id_validate_regular_expression(cls, value): ) return value - @field_validator("public_ip") - def public_ip_validate_regular_expression(cls, value): + @field_validator("routing_table_id") + def routing_table_id_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, - ): + 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 /((^\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*$))/" + 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 @@ -190,16 +142,12 @@ def to_dict(self) -> Dict[str, Any]: 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 - - # set to None if gatewayv6 (nullable) is None - # and model_fields_set contains the field - if self.gatewayv6 is None and "gatewayv6" in self.model_fields_set: - _dict["gatewayv6"] = None - + # 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 @@ -214,18 +162,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "createdAt": obj.get("createdAt"), - "gateway": obj.get("gateway"), - "gatewayv6": obj.get("gatewayv6"), + "id": obj.get("id"), + "ipv4": NetworkIPv4.from_dict(obj["ipv4"]) if obj.get("ipv4") is not None else None, + "ipv6": NetworkIPv6.from_dict(obj["ipv6"]) if obj.get("ipv6") is not None else None, "labels": obj.get("labels"), "name": obj.get("name"), - "nameservers": obj.get("nameservers"), - "nameserversV6": obj.get("nameserversV6"), - "networkId": obj.get("networkId"), - "prefixes": obj.get("prefixes"), - "prefixesV6": obj.get("prefixesV6"), - "publicIp": obj.get("publicIp"), "routed": obj.get("routed"), - "state": obj.get("state"), + "routingTableId": obj.get("routingTableId"), + "status": obj.get("status"), "updatedAt": obj.get("updatedAt"), } ) diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/network_area.py b/services/iaasalpha/src/stackit/iaasalpha/models/network_area.py deleted file mode 100644 index b72bb1e4..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/network_area.py +++ /dev/null @@ -1,145 +0,0 @@ -# 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, StrictStr, field_validator -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.network_area_ipv4 import NetworkAreaIPv4 - - -class NetworkArea(BaseModel): - """ - Object that represents a network area. - """ - - area_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID).", alias="areaId" - ) - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - ipv4: Optional[NetworkAreaIPv4] = None - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: StrictStr - project_count: Annotated[int, Field(strict=True, ge=0)] = Field( - description="The amount of projects currently referencing a specific area.", alias="projectCount" - ) - state: StrictStr = Field( - description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = [ - "areaId", - "createdAt", - "ipv4", - "labels", - "name", - "projectCount", - "state", - "updatedAt", - ] - - @field_validator("area_id") - def area_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 NetworkArea 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( - [ - "created_at", - "updated_at", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ipv4 - if self.ipv4: - _dict["ipv4"] = self.ipv4.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of NetworkArea from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "areaId": obj.get("areaId"), - "createdAt": obj.get("createdAt"), - "ipv4": NetworkAreaIPv4.from_dict(obj["ipv4"]) if obj.get("ipv4") is not None else None, - "labels": obj.get("labels"), - "name": obj.get("name"), - "projectCount": obj.get("projectCount"), - "state": obj.get("state"), - "updatedAt": obj.get("updatedAt"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/network_area_ipv4.py b/services/iaasalpha/src/stackit/iaasalpha/models/network_area_ipv4.py deleted file mode 100644 index b6b4628d..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/network_area_ipv4.py +++ /dev/null @@ -1,159 +0,0 @@ -# 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.network_range import NetworkRange -from stackit.iaasalpha.models.route import Route - - -class NetworkAreaIPv4(BaseModel): - """ - The IPv4 properties of a network area. - """ - - default_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.", alias="defaultNameservers" - ) - network_ranges: Optional[Annotated[List[NetworkRange], Field(min_length=1, max_length=64)]] = Field( - default=None, description="A list of network ranges.", alias="networkRanges" - ) - routes: Optional[List[Route]] = Field(default=None, description="A list of routes.") - transfer_network: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Classless Inter-Domain Routing (CIDR).", alias="transferNetwork" - ) - default_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( - default=None, - description="The default prefix length for networks in the network area.", - alias="defaultPrefixLen", - ) - max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( - default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" - ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( - default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" - ) - __properties: ClassVar[List[str]] = [ - "defaultNameservers", - "networkRanges", - "routes", - "transferNetwork", - "defaultPrefixLen", - "maxPrefixLen", - "minPrefixLen", - ] - - @field_validator("transfer_network") - def transfer_network_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 NetworkAreaIPv4 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 network_ranges (list) - _items = [] - if self.network_ranges: - for _item in self.network_ranges: - if _item: - _items.append(_item.to_dict()) - _dict["networkRanges"] = _items - # override the default output from pydantic by calling `to_dict()` of each item in routes (list) - _items = [] - if self.routes: - for _item in self.routes: - if _item: - _items.append(_item.to_dict()) - _dict["routes"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of NetworkAreaIPv4 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "defaultNameservers": obj.get("defaultNameservers"), - "networkRanges": ( - [NetworkRange.from_dict(_item) for _item in obj["networkRanges"]] - if obj.get("networkRanges") is not None - else None - ), - "routes": ( - [Route.from_dict(_item) for _item in obj["routes"]] if obj.get("routes") is not None else None - ), - "transferNetwork": obj.get("transferNetwork"), - "defaultPrefixLen": obj.get("defaultPrefixLen"), - "maxPrefixLen": obj.get("maxPrefixLen"), - "minPrefixLen": obj.get("minPrefixLen"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/network_area_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/network_area_list_response.py deleted file mode 100644 index 1b4ab9f6..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/network_area_list_response.py +++ /dev/null @@ -1,97 +0,0 @@ -# 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.network_area import NetworkArea - - -class NetworkAreaListResponse(BaseModel): - """ - Network area list response. - """ - - items: List[NetworkArea] = Field(description="A list of network areas.") - __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 NetworkAreaListResponse 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 NetworkAreaListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "items": ( - [NetworkArea.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/network_ipv4.py similarity index 52% rename from services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_area_payload.py rename to services/iaasalpha/src/stackit/iaasalpha/models/network_ipv4.py index 93cfddff..7352cd88 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_area_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/network_ipv4.py @@ -5,49 +5,52 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 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 +class NetworkIPv4(BaseModel): """ + Object that represents the IPv4 part of a network. + """ # noqa: E501 - 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", + gateway: Optional[object] = None + 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." ) - 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." + prefixes: List[Annotated[str, Field(strict=True)]] + public_ip: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, description="String that represents an IPv4 address.", alias="publicIp" ) - __properties: ClassVar[List[str]] = ["addressFamily", "labels", "name"] + __properties: ClassVar[List[str]] = ["gateway", "nameservers", "prefixes", "publicIp"] - @field_validator("name") - def name_validate_regular_expression(cls, value): + @field_validator("public_ip") + def public_ip_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]+)*$/") + 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*$", + 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*$/" + ) return value model_config = ConfigDict( @@ -67,7 +70,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PartialUpdateNetworkAreaPayload from a JSON string""" + """Create an instance of NetworkIPv4 from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,22 +82,29 @@ def to_dict(self) -> Dict[str, Any]: * `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. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set( + [ + "public_ip", + ] + ) _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() + # 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 PartialUpdateNetworkAreaPayload from a dict""" + """Create an instance of NetworkIPv4 from a dict""" if obj is None: return None @@ -103,13 +113,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _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"), + "gateway": obj.get("gateway"), + "nameservers": obj.get("nameservers"), + "prefixes": obj.get("prefixes"), + "publicIp": obj.get("publicIp"), } ) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_range_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/network_ipv6.py similarity index 66% rename from services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_range_payload.py rename to services/iaasalpha/src/stackit/iaasalpha/models/network_ipv6.py index 8ba9c7ac..082fcde4 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_network_area_range_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/network_ipv6.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -21,18 +21,18 @@ from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Annotated, Self -from stackit.iaasalpha.models.network_range import NetworkRange - -class CreateNetworkAreaRangePayload(BaseModel): - """ - CreateNetworkAreaRangePayload +class NetworkIPv6(BaseModel): """ + Object that represents the IPv6 part of a network. + """ # noqa: E501 - ipv4: Optional[Annotated[List[NetworkRange], Field(min_length=1, max_length=64)]] = Field( - default=None, description="A list of network ranges." + gateway: Optional[object] = None + 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]] = ["ipv4"] + prefixes: List[Annotated[str, Field(strict=True)]] + __properties: ClassVar[List[str]] = ["gateway", "nameservers", "prefixes"] model_config = ConfigDict( populate_by_name=True, @@ -51,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateNetworkAreaRangePayload from a JSON string""" + """Create an instance of NetworkIPv6 from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,18 +71,16 @@ def to_dict(self) -> Dict[str, Any]: 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 + # 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 CreateNetworkAreaRangePayload from a dict""" + """Create an instance of NetworkIPv6 from a dict""" if obj is None: return None @@ -90,6 +88,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 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} + {"gateway": obj.get("gateway"), "nameservers": obj.get("nameservers"), "prefixes": obj.get("prefixes")} ) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/network_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/network_list_response.py index 08b66750..f6d27fbc 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/network_list_response.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/network_list_response.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class NetworkListResponse(BaseModel): """ Network list response. - """ + """ # noqa: E501 items: List[Network] = Field(description="A list of networks.") __properties: ClassVar[List[str]] = ["items"] diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/network_range.py b/services/iaasalpha/src/stackit/iaasalpha/models/network_range.py deleted file mode 100644 index 56af873e..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/network_range.py +++ /dev/null @@ -1,133 +0,0 @@ -# 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 NetworkRange(BaseModel): - """ - Object that represents a network range. - """ - - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - network_range_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="networkRangeId" - ) - prefix: Annotated[str, Field(strict=True)] = Field(description="Classless Inter-Domain Routing (CIDR).") - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = ["createdAt", "networkRangeId", "prefix", "updatedAt"] - - @field_validator("network_range_id") - def network_range_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("prefix") - def prefix_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match( - r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$", - value, - ): - raise ValueError( - r"must validate the regular expression /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/" - ) - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of NetworkRange 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. - """ - excluded_fields: Set[str] = set( - [ - "created_at", - "network_range_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 NetworkRange 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"), - "networkRangeId": obj.get("networkRangeId"), - "prefix": obj.get("prefix"), - "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 deleted file mode 100644 index 3a723950..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/network_range_list_response.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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/server_console_url.py b/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_blackhole.py similarity index 81% rename from services/iaasalpha/src/stackit/iaasalpha/models/server_console_url.py rename to services/iaasalpha/src/stackit/iaasalpha/models/nexthop_blackhole.py index cea863e8..22017a0b 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/server_console_url.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_blackhole.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -22,13 +22,13 @@ from typing_extensions import Self -class ServerConsoleUrl(BaseModel): - """ - Object that represents a server console URL. +class NexthopBlackhole(BaseModel): """ + Object that represents a blackhole route. + """ # noqa: E501 - url: StrictStr - __properties: ClassVar[List[str]] = ["url"] + type: StrictStr + __properties: ClassVar[List[str]] = ["type"] model_config = ConfigDict( populate_by_name=True, @@ -47,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ServerConsoleUrl from a JSON string""" + """Create an instance of NexthopBlackhole from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,12 +71,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ServerConsoleUrl from a dict""" + """Create an instance of NexthopBlackhole from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"url": obj.get("url")}) + _obj = cls.model_validate({"type": obj.get("type")}) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/get_server_log200_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_internet.py similarity index 80% rename from services/iaasalpha/src/stackit/iaasalpha/models/get_server_log200_response.py rename to services/iaasalpha/src/stackit/iaasalpha/models/nexthop_internet.py index 33624c5f..4c6ecf32 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/get_server_log200_response.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_internet.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -22,13 +22,13 @@ from typing_extensions import Self -class GetServerLog200Response(BaseModel): - """ - GetServerLog200Response +class NexthopInternet(BaseModel): """ + Object that represents a route to the internet. + """ # noqa: E501 - output: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["output"] + type: StrictStr + __properties: ClassVar[List[str]] = ["type"] model_config = ConfigDict( populate_by_name=True, @@ -47,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GetServerLog200Response from a JSON string""" + """Create an instance of NexthopInternet from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,12 +71,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GetServerLog200Response from a dict""" + """Create an instance of NexthopInternet from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"output": obj.get("output")}) + _obj = cls.model_validate({"type": obj.get("type")}) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/image_create_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_ipv4.py similarity index 67% rename from services/iaasalpha/src/stackit/iaasalpha/models/image_create_response.py rename to services/iaasalpha/src/stackit/iaasalpha/models/nexthop_ipv4.py index 171a8040..d3033ecf 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/image_create_response.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_ipv4.py @@ -5,41 +5,42 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Annotated, Self -class ImageCreateResponse(BaseModel): - """ - Image creation response. +class NexthopIPv4(BaseModel): """ + Object that represents an IPv4 address. + """ # noqa: E501 - id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID)." - ) - upload_url: StrictStr = Field(alias="uploadUrl") - __properties: ClassVar[List[str]] = ["id", "uploadUrl"] + type: StrictStr + value: Annotated[str, Field(strict=True)] = Field(description="An IPv4 address.") + __properties: ClassVar[List[str]] = ["type", "value"] - @field_validator("id") - def id_validate_regular_expression(cls, value): + @field_validator("value") + def value_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): + 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*$", + 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}$/" + 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*$/" ) return value @@ -60,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ImageCreateResponse from a JSON string""" + """Create an instance of NexthopIPv4 from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,12 +85,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ImageCreateResponse from a dict""" + """Create an instance of NexthopIPv4 from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"id": obj.get("id"), "uploadUrl": obj.get("uploadUrl")}) + _obj = cls.model_validate({"type": obj.get("type"), "value": obj.get("value")}) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_ipv6.py b/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_ipv6.py new file mode 100644 index 00000000..27ce475c --- /dev/null +++ b/services/iaasalpha/src/stackit/iaasalpha/models/nexthop_ipv6.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + IaaS-API + + This API allows you to create and modify IaaS resources. + + The version of the OpenAPI document: 2alpha1 + Contact: stackit-iaas@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class NexthopIPv6(BaseModel): + """ + Object that represents an IPv6 address. + """ # noqa: E501 + + type: StrictStr + value: Annotated[str, Field(strict=True)] = Field(description="An IPv6 address.") + __properties: ClassVar[List[str]] = ["type", "value"] + + @field_validator("value") + def value_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match( + r"^\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-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 NexthopIPv6 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 NexthopIPv6 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"type": obj.get("type"), "value": obj.get("value")}) + return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/nic.py b/services/iaasalpha/src/stackit/iaasalpha/models/nic.py deleted file mode 100644 index 5f6bd26a..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/nic.py +++ /dev/null @@ -1,271 +0,0 @@ -# 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, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.allowed_addresses_inner import AllowedAddressesInner - - -class NIC(BaseModel): - """ - Object that represents a network interface. - """ - - allowed_addresses: Optional[List[AllowedAddressesInner]] = Field( - default=None, description="A list of IPs or CIDR notations.", alias="allowedAddresses" - ) - device: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ipv4: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - ipv6: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="String that represents an IPv6 address." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - mac: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an MAC address." - ) - 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." - ) - network_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="networkId" - ) - nic_security: Optional[StrictBool] = Field( - default=None, - description="If this is set to false, then no security groups will apply to this network interface.", - alias="nicSecurity", - ) - security_groups: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="A list of UUIDs.", alias="securityGroups" - ) - status: Optional[StrictStr] = None - type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "allowedAddresses", - "device", - "id", - "ipv4", - "ipv6", - "labels", - "mac", - "name", - "networkId", - "nicSecurity", - "securityGroups", - "status", - "type", - ] - - @field_validator("device") - def device_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("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("ipv4") - def ipv4_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("ipv6") - def ipv6_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match( - r"^\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-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("mac") - def mac_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$", value): - raise ValueError(r"must validate the regular expression /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/") - 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("network_id") - def network_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 NIC 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. - """ - excluded_fields: Set[str] = set( - [ - "device", - "id", - "mac", - "network_id", - "status", - "type", - ] - ) - - _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 allowed_addresses (list) - _items = [] - if self.allowed_addresses: - for _item in self.allowed_addresses: - if _item: - _items.append(_item.to_dict()) - _dict["allowedAddresses"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of NIC from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "allowedAddresses": ( - [AllowedAddressesInner.from_dict(_item) for _item in obj["allowedAddresses"]] - if obj.get("allowedAddresses") is not None - else None - ), - "device": obj.get("device"), - "id": obj.get("id"), - "ipv4": obj.get("ipv4"), - "ipv6": obj.get("ipv6"), - "labels": obj.get("labels"), - "mac": obj.get("mac"), - "name": obj.get("name"), - "networkId": obj.get("networkId"), - "nicSecurity": obj.get("nicSecurity"), - "securityGroups": obj.get("securityGroups"), - "status": obj.get("status"), - "type": obj.get("type"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/nic_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/nic_list_response.py deleted file mode 100644 index c7768ba7..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/nic_list_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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.nic import NIC - - -class NICListResponse(BaseModel): - """ - NIC list response. - """ - - items: List[NIC] = Field(description="A list of network interfaces.") - __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 NICListResponse 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 NICListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"items": [NIC.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_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_payload.py index f0c1e8e7..124a92fc 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/partial_update_network_payload.py @@ -5,45 +5,48 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 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, -) +from stackit.iaasalpha.models.update_network_ipv4_body import UpdateNetworkIPv4Body +from stackit.iaasalpha.models.update_network_ipv6_body import UpdateNetworkIPv6Body class PartialUpdateNetworkPayload(BaseModel): """ Object that represents the request body for a network update. - """ + """ # noqa: E501 - address_family: Optional[UpdateNetworkAddressFamily] = Field(default=None, alias="addressFamily") + ipv4: Optional[UpdateNetworkIPv4Body] = None + ipv6: Optional[UpdateNetworkIPv6Body] = None labels: Optional[Dict[str, Any]] = Field( default=None, description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( + name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." ) 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"] + routing_table_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( + default=None, description="Universally Unique Identifier (UUID).", alias="routingTableId" + ) + __properties: ClassVar[List[str]] = ["ipv4", "ipv6", "labels", "name", "routed", "routingTableId"] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -51,8 +54,20 @@ def name_validate_regular_expression(cls, value): if value is None: return value - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") + if not re.match(r"^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$/") + return value + + @field_validator("routing_table_id") + def routing_table_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( @@ -92,9 +107,12 @@ def to_dict(self) -> Dict[str, Any]: 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() + # 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 @@ -108,14 +126,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "addressFamily": ( - UpdateNetworkAddressFamily.from_dict(obj["addressFamily"]) - if obj.get("addressFamily") is not None - else None - ), + "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, "labels": obj.get("labels"), "name": obj.get("name"), "routed": obj.get("routed"), + "routingTableId": obj.get("routingTableId"), } ) return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/port_range.py b/services/iaasalpha/src/stackit/iaasalpha/models/port_range.py deleted file mode 100644 index f026681c..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/port_range.py +++ /dev/null @@ -1,87 +0,0 @@ -# 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 - - -class PortRange(BaseModel): - """ - Object that represents a range of ports. - """ - - max: Annotated[int, Field(le=65535, strict=True, ge=0)] = Field( - description="The maximum port number. Should be greater or equal to the minimum." - ) - min: Annotated[int, Field(le=65535, strict=True, ge=0)] = Field( - description="The minimum port number. Should be less or equal to the maximum." - ) - __properties: ClassVar[List[str]] = ["max", "min"] - - 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 PortRange 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 PortRange from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"max": obj.get("max"), "min": obj.get("min")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/project.py b/services/iaasalpha/src/stackit/iaasalpha/models/project.py deleted file mode 100644 index 073520a4..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/project.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.area_id import AreaId - - -class Project(BaseModel): - """ - Object that represents a STACKIT project. - """ - - area_id: AreaId = Field(alias="areaId") - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - internet_access: Optional[StrictBool] = Field(default=None, alias="internetAccess") - openstack_project_id: Optional[Annotated[str, Field(min_length=32, strict=True, max_length=32)]] = Field( - default=None, - description="The identifier (ID) of the OpenStack project in the main region eu01.", - alias="openstackProjectId", - ) - project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID).", alias="projectId" - ) - state: StrictStr = Field( - description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = [ - "areaId", - "createdAt", - "internetAccess", - "openstackProjectId", - "projectId", - "state", - "updatedAt", - ] - - @field_validator("openstack_project_id") - def openstack_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]{32}$", value): - raise ValueError(r"must validate the regular expression /^[0-9a-f]{32}$/") - return value - - @field_validator("project_id") - def project_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 Project 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. - """ - excluded_fields: Set[str] = set( - [ - "created_at", - "openstack_project_id", - "updated_at", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of area_id - if self.area_id: - _dict["areaId"] = self.area_id.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Project from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "areaId": AreaId.from_dict(obj["areaId"]) if obj.get("areaId") is not None else None, - "createdAt": obj.get("createdAt"), - "internetAccess": obj.get("internetAccess"), - "openstackProjectId": obj.get("openstackProjectId"), - "projectId": obj.get("projectId"), - "state": obj.get("state"), - "updatedAt": obj.get("updatedAt"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/project_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/project_list_response.py deleted file mode 100644 index 2c9069cf..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/project_list_response.py +++ /dev/null @@ -1,84 +0,0 @@ -# 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 - - -class ProjectListResponse(BaseModel): - """ - Project list response. - """ - - items: List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - description="A list of STACKIT projects." - ) - __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 ProjectListResponse 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 ProjectListResponse 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/protocol.py b/services/iaasalpha/src/stackit/iaasalpha/models/protocol.py deleted file mode 100644 index b0df5c40..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/protocol.py +++ /dev/null @@ -1,88 +0,0 @@ -# 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 Annotated, Self - - -class Protocol(BaseModel): - """ - The schema for a protocol of a security group rule. - """ - - name: Optional[StrictStr] = Field( - default=None, - description="The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`.", - ) - number: Optional[Annotated[int, Field(le=255, strict=True, ge=0)]] = Field( - default=None, description="The protocol number which the rule should match." - ) - __properties: ClassVar[List[str]] = ["name", "number"] - - 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 Protocol 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 Protocol from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"name": obj.get("name"), "number": obj.get("number")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/public_ip.py b/services/iaasalpha/src/stackit/iaasalpha/models/public_ip.py deleted file mode 100644 index f8e3c22b..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/public_ip.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 PublicIp(BaseModel): - """ - Object that represents a public IP. - """ - - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ip: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, - description="Associate the public IP with a network interface or a virtual IP (ID).", - alias="networkInterface", - ) - __properties: ClassVar[List[str]] = ["id", "ip", "labels", "networkInterface"] - - @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("ip") - def ip_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("network_interface") - def network_interface_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 PublicIp 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", - "ip", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if network_interface (nullable) is None - # and model_fields_set contains the field - if self.network_interface is None and "network_interface" in self.model_fields_set: - _dict["networkInterface"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PublicIp 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"), - "ip": obj.get("ip"), - "labels": obj.get("labels"), - "networkInterface": obj.get("networkInterface"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/public_ip_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/public_ip_list_response.py deleted file mode 100644 index 27b85925..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/public_ip_list_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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.public_ip import PublicIp - - -class PublicIpListResponse(BaseModel): - """ - Public IP list response. - """ - - items: List[PublicIp] = Field(description="A list of public IPs.") - __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 PublicIpListResponse 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 PublicIpListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"items": [PublicIp.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/public_network.py b/services/iaasalpha/src/stackit/iaasalpha/models/public_network.py deleted file mode 100644 index 15cb1253..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/public_network.py +++ /dev/null @@ -1,95 +0,0 @@ -# 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 PublicNetwork(BaseModel): - """ - Public network. - """ - - cidr: Annotated[str, Field(strict=True)] = Field(description="Classless Inter-Domain Routing (CIDR).") - __properties: ClassVar[List[str]] = ["cidr"] - - @field_validator("cidr") - def cidr_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match( - r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$", - value, - ): - raise ValueError( - r"must validate the regular expression /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/" - ) - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PublicNetwork from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PublicNetwork from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"cidr": obj.get("cidr")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/public_network_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/public_network_list_response.py deleted file mode 100644 index 0eceb614..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/public_network_list_response.py +++ /dev/null @@ -1,97 +0,0 @@ -# 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.public_network import PublicNetwork - - -class PublicNetworkListResponse(BaseModel): - """ - Public network list response. - """ - - items: List[PublicNetwork] = Field(description="A list of public networks.") - __properties: ClassVar[List[str]] = ["items"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PublicNetworkListResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict["items"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PublicNetworkListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "items": ( - [PublicNetwork.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None - ) - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/quota.py b/services/iaasalpha/src/stackit/iaasalpha/models/quota.py deleted file mode 100644 index b913f15a..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/quota.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 deleted file mode 100644 index fb49e9b5..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/quota_list.py +++ /dev/null @@ -1,165 +0,0 @@ -# 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 deleted file mode 100644 index 980f9842..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/quota_list_response.py +++ /dev/null @@ -1,89 +0,0 @@ -# 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/remove_member_from_virtual_ip_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/remove_member_from_virtual_ip_payload.py deleted file mode 100644 index 5a51d2fa..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/remove_member_from_virtual_ip_payload.py +++ /dev/null @@ -1,94 +0,0 @@ -# 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 RemoveMemberFromVirtualIPPayload(BaseModel): - """ - Object that represents a virtual IP member. - """ - - member: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID)." - ) - __properties: ClassVar[List[str]] = ["member"] - - @field_validator("member") - def member_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 RemoveMemberFromVirtualIPPayload 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 RemoveMemberFromVirtualIPPayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"member": obj.get("member")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/request.py b/services/iaasalpha/src/stackit/iaasalpha/models/request.py deleted file mode 100644 index 3f0aa3f1..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/request.py +++ /dev/null @@ -1,127 +0,0 @@ -# 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 - -from stackit.iaasalpha.models.request_resource import RequestResource - - -class Request(BaseModel): - """ - Object that represents a request. - """ - - details: Optional[StrictStr] = None - request_action: StrictStr = Field( - description="Object that represents a resource action. Possible values: `CREATE`, `DELETE`, `UPDATE`.", - alias="requestAction", - ) - request_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Identifier (ID) representing a single API request.", alias="requestId" - ) - request_type: StrictStr = Field( - description="Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`.", - alias="requestType", - ) - resources: List[RequestResource] - status: StrictStr = Field( - description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." - ) - __properties: ClassVar[List[str]] = ["details", "requestAction", "requestId", "requestType", "resources", "status"] - - @field_validator("request_id") - def request_id_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^req-[0-9a-f]{32}$", value): - raise ValueError(r"must validate the regular expression /^req-[0-9a-f]{32}$/") - 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 Request 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 resources (list) - _items = [] - if self.resources: - for _item in self.resources: - if _item: - _items.append(_item.to_dict()) - _dict["resources"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Request from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "details": obj.get("details"), - "requestAction": obj.get("requestAction"), - "requestId": obj.get("requestId"), - "requestType": obj.get("requestType"), - "resources": ( - [RequestResource.from_dict(_item) for _item in obj["resources"]] - if obj.get("resources") is not None - else None - ), - "status": obj.get("status"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/request_resource.py b/services/iaasalpha/src/stackit/iaasalpha/models/request_resource.py deleted file mode 100644 index ed2eb165..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/request_resource.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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 RequestResource(BaseModel): - """ - Object that represents a resource as part of a request. - """ - - id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID)." - ) - status: StrictStr = Field( - description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`." - ) - type: StrictStr = Field( - description="Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`." - ) - __properties: ClassVar[List[str]] = ["id", "status", "type"] - - @field_validator("id") - 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 RequestResource 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 RequestResource 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"), "status": obj.get("status"), "type": obj.get("type")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/rescue_server_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/rescue_server_payload.py deleted file mode 100644 index a1e9f646..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/rescue_server_payload.py +++ /dev/null @@ -1,94 +0,0 @@ -# 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 RescueServerPayload(BaseModel): - """ - RescueServerPayload - """ - - image: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID)." - ) - __properties: ClassVar[List[str]] = ["image"] - - @field_validator("image") - def image_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 RescueServerPayload 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 RescueServerPayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"image": obj.get("image")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/resize_server_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/resize_server_payload.py deleted file mode 100644 index 5b3cf388..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/resize_server_payload.py +++ /dev/null @@ -1,92 +0,0 @@ -# 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 ResizeServerPayload(BaseModel): - """ - ResizeServerPayload - """ - - machine_type: Annotated[str, Field(strict=True, max_length=63)] = Field( - description="The name for a General Object. Matches Names and also UUIDs.", alias="machineType" - ) - __properties: ClassVar[List[str]] = ["machineType"] - - @field_validator("machine_type") - def machine_type_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 ResizeServerPayload 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 ResizeServerPayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"machineType": obj.get("machineType")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/resize_volume_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/resize_volume_payload.py deleted file mode 100644 index 80b67f48..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/resize_volume_payload.py +++ /dev/null @@ -1,82 +0,0 @@ -# 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, StrictInt -from typing_extensions import Self - - -class ResizeVolumePayload(BaseModel): - """ - ResizeVolumePayload - """ - - size: StrictInt = Field(description="Size in Gigabyte.") - __properties: ClassVar[List[str]] = ["size"] - - 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 ResizeVolumePayload 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 ResizeVolumePayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"size": obj.get("size")}) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/route.py b/services/iaasalpha/src/stackit/iaasalpha/models/route.py index 66ba99d3..b97464c9 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/route.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/route.py @@ -5,73 +5,52 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 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 +from stackit.iaasalpha.models.route_destination import RouteDestination +from stackit.iaasalpha.models.route_nexthop import RouteNexthop + class Route(BaseModel): """ Object represents a network route. - """ + """ # noqa: E501 created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) + destination: RouteDestination + 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) - nexthop: Annotated[str, Field(strict=True)] = Field(description="Object that represents an IP address.") - prefix: Annotated[str, Field(strict=True)] = Field(description="Classless Inter-Domain Routing (CIDR).") - route_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="routeId" - ) + nexthop: RouteNexthop updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) - __properties: ClassVar[List[str]] = ["createdAt", "labels", "nexthop", "prefix", "routeId", "updatedAt"] - - @field_validator("nexthop") - def nexthop_validate_regular_expression(cls, value): - """Validates the regular expression""" - 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 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 + __properties: ClassVar[List[str]] = ["createdAt", "destination", "id", "labels", "nexthop", "updatedAt"] - @field_validator("route_id") - def route_id_validate_regular_expression(cls, value): + @field_validator("id") + def id_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value @@ -118,7 +97,7 @@ def to_dict(self) -> Dict[str, Any]: excluded_fields: Set[str] = set( [ "created_at", - "route_id", + "id", "updated_at", ] ) @@ -128,6 +107,12 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict["destination"] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of nexthop + if self.nexthop: + _dict["nexthop"] = self.nexthop.to_dict() return _dict @classmethod @@ -142,10 +127,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "createdAt": obj.get("createdAt"), + "destination": ( + RouteDestination.from_dict(obj["destination"]) if obj.get("destination") is not None else None + ), + "id": obj.get("id"), "labels": obj.get("labels"), - "nexthop": obj.get("nexthop"), - "prefix": obj.get("prefix"), - "routeId": obj.get("routeId"), + "nexthop": RouteNexthop.from_dict(obj["nexthop"]) if obj.get("nexthop") is not None else None, "updatedAt": obj.get("updatedAt"), } ) diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/area_id.py b/services/iaasalpha/src/stackit/iaasalpha/models/route_destination.py similarity index 65% rename from services/iaasalpha/src/stackit/iaasalpha/models/area_id.py rename to services/iaasalpha/src/stackit/iaasalpha/models/route_destination.py index c75cecfe..ecb73e0b 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/area_id.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/route_destination.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -21,37 +21,37 @@ from pydantic import ( BaseModel, ConfigDict, - Field, ValidationError, field_validator, ) -from typing_extensions import Annotated, Self +from typing_extensions import Self -from stackit.iaasalpha.models.static_area_id import StaticAreaID +from stackit.iaasalpha.models.destination_cidrv4 import DestinationCIDRv4 +from stackit.iaasalpha.models.destination_cidrv6 import DestinationCIDRv6 -AREAID_ONE_OF_SCHEMAS = ["StaticAreaID", "str"] +ROUTEDESTINATION_ONE_OF_SCHEMAS = ["DestinationCIDRv4", "DestinationCIDRv6"] -class AreaId(BaseModel): +class RouteDestination(BaseModel): """ - The identifier (ID) of an area. + RouteDestination """ - # data type: str - oneof_schema_1_validator: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - # data type: StaticAreaID - oneof_schema_2_validator: Optional[StaticAreaID] = None - actual_instance: Optional[Union[StaticAreaID, str]] = None - one_of_schemas: Set[str] = {"StaticAreaID", "str"} + # data type: DestinationCIDRv4 + oneof_schema_1_validator: Optional[DestinationCIDRv4] = None + # data type: DestinationCIDRv6 + oneof_schema_2_validator: Optional[DestinationCIDRv6] = None + actual_instance: Optional[Union[DestinationCIDRv4, DestinationCIDRv6]] = None + one_of_schemas: Set[str] = {"DestinationCIDRv4", "DestinationCIDRv6"} model_config = ConfigDict( validate_assignment=True, protected_namespaces=(), ) + discriminator_value_class_map: Dict[str, str] = {} + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: @@ -64,24 +64,23 @@ def __init__(self, *args, **kwargs) -> None: @field_validator("actual_instance") def actual_instance_must_validate_oneof(cls, v): - instance = AreaId.model_construct() + instance = RouteDestination.model_construct() error_messages = [] match = 0 - # validate data type: str - try: - instance.oneof_schema_1_validator = v + # validate data type: DestinationCIDRv4 + if not isinstance(v, DestinationCIDRv4): + error_messages.append(f"Error! Input type `{type(v)}` is not `DestinationCIDRv4`") + else: match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: StaticAreaID - if not isinstance(v, StaticAreaID): - error_messages.append(f"Error! Input type `{type(v)}` is not `StaticAreaID`") + # validate data type: DestinationCIDRv6 + if not isinstance(v, DestinationCIDRv6): + error_messages.append(f"Error! Input type `{type(v)}` is not `DestinationCIDRv6`") else: match += 1 if match == 0: # no match raise ValueError( - "No match found when setting `actual_instance` in AreaId with oneOf schemas: StaticAreaID, str. Details: " + "No match found when setting `actual_instance` in RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6. Details: " + ", ".join(error_messages) ) else: @@ -98,18 +97,15 @@ def from_json(cls, json_str: str) -> Self: error_messages = [] match = 0 - # deserialize data into str + # deserialize data into DestinationCIDRv4 try: - # validation - instance.oneof_schema_1_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_1_validator + instance.actual_instance = DestinationCIDRv4.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into StaticAreaID + # deserialize data into DestinationCIDRv6 try: - instance.actual_instance = StaticAreaID.from_json(json_str) + instance.actual_instance = DestinationCIDRv6.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) @@ -117,13 +113,13 @@ def from_json(cls, json_str: str) -> Self: if match > 1: # more than 1 match raise ValueError( - "Multiple matches found when deserializing the JSON string into AreaId with oneOf schemas: StaticAreaID, str. Details: " + "Multiple matches found when deserializing the JSON string into RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6. Details: " + ", ".join(error_messages) ) elif match == 0: # no match raise ValueError( - "No match found when deserializing the JSON string into AreaId with oneOf schemas: StaticAreaID, str. Details: " + "No match found when deserializing the JSON string into RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6. Details: " + ", ".join(error_messages) ) else: @@ -139,7 +135,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], StaticAreaID, str]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], DestinationCIDRv4, DestinationCIDRv6]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/route_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/route_list_response.py index 2016bf76..e51d29c1 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/route_list_response.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/route_list_response.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class RouteListResponse(BaseModel): """ Route list response. - """ + """ # noqa: E501 items: List[Route] = Field(description="A list of routes.") __properties: ClassVar[List[str]] = ["items"] diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/allowed_addresses_inner.py b/services/iaasalpha/src/stackit/iaasalpha/models/route_nexthop.py similarity index 54% rename from services/iaasalpha/src/stackit/iaasalpha/models/allowed_addresses_inner.py rename to services/iaasalpha/src/stackit/iaasalpha/models/route_nexthop.py index 651efec4..1b254c69 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/allowed_addresses_inner.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/route_nexthop.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -21,37 +21,43 @@ from pydantic import ( BaseModel, ConfigDict, - Field, ValidationError, field_validator, ) -from typing_extensions import Annotated, Self +from typing_extensions import Self +from stackit.iaasalpha.models.nexthop_blackhole import NexthopBlackhole +from stackit.iaasalpha.models.nexthop_internet import NexthopInternet +from stackit.iaasalpha.models.nexthop_ipv4 import NexthopIPv4 +from stackit.iaasalpha.models.nexthop_ipv6 import NexthopIPv6 -ALLOWEDADDRESSESINNER_ONE_OF_SCHEMAS = ["str"] +ROUTENEXTHOP_ONE_OF_SCHEMAS = ["NexthopBlackhole", "NexthopIPv4", "NexthopIPv6", "NexthopInternet"] -class AllowedAddressesInner(BaseModel): + +class RouteNexthop(BaseModel): """ - AllowedAddressesInner + RouteNexthop """ - # data type: str - oneof_schema_1_validator: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - # data type: str - oneof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Classless Inter-Domain Routing (CIDR)." - ) - actual_instance: Optional[Union[str]] = None - one_of_schemas: Set[str] = {"str"} + # data type: NexthopIPv4 + oneof_schema_1_validator: Optional[NexthopIPv4] = None + # data type: NexthopIPv6 + oneof_schema_2_validator: Optional[NexthopIPv6] = None + # data type: NexthopInternet + oneof_schema_3_validator: Optional[NexthopInternet] = None + # data type: NexthopBlackhole + oneof_schema_4_validator: Optional[NexthopBlackhole] = None + actual_instance: Optional[Union[NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet]] = None + one_of_schemas: Set[str] = {"NexthopBlackhole", "NexthopIPv4", "NexthopIPv6", "NexthopInternet"} model_config = ConfigDict( validate_assignment=True, protected_namespaces=(), ) + discriminator_value_class_map: Dict[str, str] = {} + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: @@ -64,25 +70,33 @@ def __init__(self, *args, **kwargs) -> None: @field_validator("actual_instance") def actual_instance_must_validate_oneof(cls, v): - instance = AllowedAddressesInner.model_construct() + instance = RouteNexthop.model_construct() error_messages = [] match = 0 - # validate data type: str - try: - instance.oneof_schema_1_validator = v + # validate data type: NexthopIPv4 + if not isinstance(v, NexthopIPv4): + error_messages.append(f"Error! Input type `{type(v)}` is not `NexthopIPv4`") + else: match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: str - try: - instance.oneof_schema_2_validator = v + # validate data type: NexthopIPv6 + if not isinstance(v, NexthopIPv6): + error_messages.append(f"Error! Input type `{type(v)}` is not `NexthopIPv6`") + else: + match += 1 + # validate data type: NexthopInternet + if not isinstance(v, NexthopInternet): + error_messages.append(f"Error! Input type `{type(v)}` is not `NexthopInternet`") + else: + match += 1 + # validate data type: NexthopBlackhole + if not isinstance(v, NexthopBlackhole): + error_messages.append(f"Error! Input type `{type(v)}` is not `NexthopBlackhole`") + else: match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) if match == 0: # no match raise ValueError( - "No match found when setting `actual_instance` in AllowedAddressesInner with oneOf schemas: str. Details: " + "No match found when setting `actual_instance` in RouteNexthop with oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet. Details: " + ", ".join(error_messages) ) else: @@ -99,21 +113,27 @@ def from_json(cls, json_str: str) -> Self: error_messages = [] match = 0 - # deserialize data into str + # deserialize data into NexthopIPv4 + try: + instance.actual_instance = NexthopIPv4.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into NexthopIPv6 + try: + instance.actual_instance = NexthopIPv6.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into NexthopInternet try: - # validation - instance.oneof_schema_1_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_1_validator + instance.actual_instance = NexthopInternet.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into str + # deserialize data into NexthopBlackhole try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator + instance.actual_instance = NexthopBlackhole.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) @@ -121,13 +141,13 @@ def from_json(cls, json_str: str) -> Self: if match > 1: # more than 1 match raise ValueError( - "Multiple matches found when deserializing the JSON string into AllowedAddressesInner with oneOf schemas: str. Details: " + "Multiple matches found when deserializing the JSON string into RouteNexthop with oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet. Details: " + ", ".join(error_messages) ) elif match == 0: # no match raise ValueError( - "No match found when deserializing the JSON string into AllowedAddressesInner with oneOf schemas: str. Details: " + "No match found when deserializing the JSON string into RouteNexthop with oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet. Details: " + ", ".join(error_messages) ) else: @@ -143,7 +163,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], str]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/routing_table.py similarity index 73% rename from services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_payload.py rename to services/iaasalpha/src/stackit/iaasalpha/models/routing_table.py index 48bc4575..863b038c 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/create_security_group_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/routing_table.py @@ -5,35 +5,37 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime 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.security_group_rule import SecurityGroupRule - -class CreateSecurityGroupPayload(BaseModel): - """ - Object that represents a security group. +class RoutingTable(BaseModel): """ + An object representing a routing table. + """ # noqa: E501 created_at: Optional[datetime] = Field( default=None, description="Date-time when resource was created.", alias="createdAt" ) + default: Optional[StrictBool] = Field( + default=True, + description="This is the default routing table for this area. It can't be deleted and is used if the user does not specify it otherwise.", + ) description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." ) @@ -44,27 +46,21 @@ class CreateSecurityGroupPayload(BaseModel): default=None, description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) - name: Annotated[str, Field(strict=True, max_length=63)] = Field( + name: Annotated[str, Field(strict=True, max_length=127)] = Field( description="The name for a General Object. Matches Names and also UUIDs." ) - rules: Optional[List[SecurityGroupRule]] = Field( - default=None, description="A list containing security group rule objects." - ) - stateful: Optional[StrictBool] = Field( - default=True, - description="Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server.", - ) + system_routes: Optional[StrictBool] = Field(default=True, alias="systemRoutes") updated_at: Optional[datetime] = Field( default=None, description="Date-time when resource was last updated.", alias="updatedAt" ) __properties: ClassVar[List[str]] = [ "createdAt", + "default", "description", "id", "labels", "name", - "rules", - "stateful", + "systemRoutes", "updatedAt", ] @@ -83,8 +79,8 @@ def id_validate_regular_expression(cls, 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]+)*$/") + if not re.match(r"^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$/") return value model_config = ConfigDict( @@ -104,7 +100,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateSecurityGroupPayload from a JSON string""" + """Create an instance of RoutingTable from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -124,8 +120,8 @@ def to_dict(self) -> Dict[str, Any]: excluded_fields: Set[str] = set( [ "created_at", + "default", "id", - "rules", "updated_at", ] ) @@ -135,18 +131,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in rules (list) - _items = [] - if self.rules: - for _item in self.rules: - if _item: - _items.append(_item.to_dict()) - _dict["rules"] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateSecurityGroupPayload from a dict""" + """Create an instance of RoutingTable from a dict""" if obj is None: return None @@ -156,16 +145,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "createdAt": obj.get("createdAt"), + "default": obj.get("default") if obj.get("default") is not None else True, "description": obj.get("description"), "id": obj.get("id"), "labels": obj.get("labels"), "name": obj.get("name"), - "rules": ( - [SecurityGroupRule.from_dict(_item) for _item in obj["rules"]] - if obj.get("rules") is not None - else None - ), - "stateful": obj.get("stateful") if obj.get("stateful") is not None else True, + "systemRoutes": obj.get("systemRoutes") if obj.get("systemRoutes") is not None else True, "updatedAt": obj.get("updatedAt"), } ) diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/machine_type_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/routing_table_list_response.py similarity index 80% rename from services/iaasalpha/src/stackit/iaasalpha/models/machine_type_list_response.py rename to services/iaasalpha/src/stackit/iaasalpha/models/routing_table_list_response.py index a7ba17f1..32fe0a2f 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/machine_type_list_response.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/routing_table_list_response.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -21,15 +21,15 @@ from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Self -from stackit.iaasalpha.models.machine_type import MachineType +from stackit.iaasalpha.models.routing_table import RoutingTable -class MachineTypeListResponse(BaseModel): - """ - Machine type list response. +class RoutingTableListResponse(BaseModel): """ + Routing table response. + """ # noqa: E501 - items: List[MachineType] = Field(description="Machine type list.") + items: List[RoutingTable] = Field(description="A list of routing tables.") __properties: ClassVar[List[str]] = ["items"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MachineTypeListResponse from a JSON string""" + """Create an instance of RoutingTableListResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MachineTypeListResponse from a dict""" + """Create an instance of RoutingTableListResponse from a dict""" if obj is None: return None @@ -90,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "items": ( - [MachineType.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + [RoutingTable.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None ) } ) diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/security_group_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/security_group_list_response.py deleted file mode 100644 index 638495d7..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/security_group_list_response.py +++ /dev/null @@ -1,97 +0,0 @@ -# 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.security_group import SecurityGroup - - -class SecurityGroupListResponse(BaseModel): - """ - Security group list response. - """ - - items: List[SecurityGroup] = Field(description="A list containing security group 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 SecurityGroupListResponse 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 SecurityGroupListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "items": ( - [SecurityGroup.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/security_group_rule.py b/services/iaasalpha/src/stackit/iaasalpha/models/security_group_rule.py deleted file mode 100644 index 2427d2db..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/security_group_rule.py +++ /dev/null @@ -1,201 +0,0 @@ -# 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 - -from stackit.iaasalpha.models.icmp_parameters import ICMPParameters -from stackit.iaasalpha.models.port_range import PortRange -from stackit.iaasalpha.models.protocol import Protocol - - -class SecurityGroupRule(BaseModel): - """ - Object that represents a security group rule. - """ - - description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( - default=None, description="Description Object. Allows string up to 255 Characters." - ) - direction: StrictStr = Field(description="The direction of the traffic which the rule should match.") - ethertype: Optional[StrictStr] = Field(default="IPv4", description="The ethertype which the rule should match.") - icmp_parameters: Optional[ICMPParameters] = Field(default=None, alias="icmpParameters") - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ip_range: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="The remote IP range which the rule should match.", alias="ipRange" - ) - port_range: Optional[PortRange] = Field(default=None, alias="portRange") - remote_security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, - description="The remote security group which the rule should match.", - alias="remoteSecurityGroupId", - ) - security_group_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="securityGroupId" - ) - protocol: Optional[Protocol] = None - __properties: ClassVar[List[str]] = [ - "description", - "direction", - "ethertype", - "icmpParameters", - "id", - "ipRange", - "portRange", - "remoteSecurityGroupId", - "securityGroupId", - "protocol", - ] - - @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("ip_range") - def ip_range_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 - - @field_validator("remote_security_group_id") - def remote_security_group_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("security_group_id") - def security_group_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 SecurityGroupRule 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", - "security_group_id", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of icmp_parameters - if self.icmp_parameters: - _dict["icmpParameters"] = self.icmp_parameters.to_dict() - # override the default output from pydantic by calling `to_dict()` of port_range - if self.port_range: - _dict["portRange"] = self.port_range.to_dict() - # override the default output from pydantic by calling `to_dict()` of protocol - if self.protocol: - _dict["protocol"] = self.protocol.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SecurityGroupRule from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "description": obj.get("description"), - "direction": obj.get("direction"), - "ethertype": obj.get("ethertype") if obj.get("ethertype") is not None else "IPv4", - "icmpParameters": ( - ICMPParameters.from_dict(obj["icmpParameters"]) if obj.get("icmpParameters") is not None else None - ), - "id": obj.get("id"), - "ipRange": obj.get("ipRange"), - "portRange": PortRange.from_dict(obj["portRange"]) if obj.get("portRange") is not None else None, - "remoteSecurityGroupId": obj.get("remoteSecurityGroupId"), - "securityGroupId": obj.get("securityGroupId"), - "protocol": Protocol.from_dict(obj["protocol"]) if obj.get("protocol") is not None else None, - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/security_group_rule_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/security_group_rule_list_response.py deleted file mode 100644 index a2c0ad6a..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/security_group_rule_list_response.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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.security_group_rule import SecurityGroupRule - - -class SecurityGroupRuleListResponse(BaseModel): - """ - Security group rule list response. - """ - - items: List[SecurityGroupRule] = Field(description="A list containing security group rule 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 SecurityGroupRuleListResponse 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 SecurityGroupRuleListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "items": ( - [SecurityGroupRule.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/security_group_rule_protocol.py b/services/iaasalpha/src/stackit/iaasalpha/models/security_group_rule_protocol.py deleted file mode 100644 index 60bff2b9..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/security_group_rule_protocol.py +++ /dev/null @@ -1,89 +0,0 @@ -# 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.protocol import Protocol - - -class SecurityGroupRuleProtocol(BaseModel): - """ - The internet protocol which the rule matches. - """ - - protocol: Optional[Protocol] = None - __properties: ClassVar[List[str]] = ["protocol"] - - 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 SecurityGroupRuleProtocol 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 protocol - if self.protocol: - _dict["protocol"] = self.protocol.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SecurityGroupRuleProtocol from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"protocol": Protocol.from_dict(obj["protocol"]) if obj.get("protocol") is not None else None} - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/server.py b/services/iaasalpha/src/stackit/iaasalpha/models/server.py deleted file mode 100644 index 44246e12..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/server.py +++ /dev/null @@ -1,321 +0,0 @@ -# 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, Union - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBytes, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.boot_volume import BootVolume -from stackit.iaasalpha.models.create_server_payload_networking import ( - CreateServerPayloadNetworking, -) -from stackit.iaasalpha.models.server_maintenance import ServerMaintenance -from stackit.iaasalpha.models.server_network import ServerNetwork - - -class Server(BaseModel): - """ - Representation of a single server object. - """ - - affinity_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="The affinity group the server is assigned to.", alias="affinityGroup" - ) - availability_zone: Optional[StrictStr] = Field( - default=None, - description="This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone.", - alias="availabilityZone", - ) - boot_volume: Optional[BootVolume] = Field(default=None, alias="bootVolume") - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - error_message: Optional[StrictStr] = Field(default=None, description="An error message.", alias="errorMessage") - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - image_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="imageId" - ) - keypair_name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( - default=None, description="The SSH keypair used during the server creation.", alias="keypairName" - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - launched_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was launched.", alias="launchedAt" - ) - machine_type: Annotated[str, Field(strict=True, max_length=63)] = Field( - description="Name of the machine type the server shall belong to.", alias="machineType" - ) - maintenance_window: Optional[ServerMaintenance] = Field(default=None, alias="maintenanceWindow") - name: Annotated[str, Field(strict=True, max_length=63)] = Field(description="The name for a Server.") - networking: Optional[CreateServerPayloadNetworking] = None - nics: Optional[List[ServerNetwork]] = Field( - default=None, - description="The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested.", - ) - power_status: Optional[StrictStr] = Field( - default=None, - description="The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`.", - alias="powerStatus", - ) - security_groups: Optional[List[Annotated[str, Field(strict=True, max_length=63)]]] = Field( - default=None, description="The initial security groups for the server creation.", alias="securityGroups" - ) - service_account_mails: Optional[ - Annotated[List[Annotated[str, Field(strict=True, max_length=255)]], Field(max_length=1)] - ] = Field( - default=None, - description="A list of service account mails. Only shown when detailed information is requested.", - alias="serviceAccountMails", - ) - status: Optional[StrictStr] = Field( - default=None, - description="The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - user_data: Optional[Union[StrictBytes, StrictStr]] = Field( - default=None, - description="User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested.", - alias="userData", - ) - volumes: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="The list of volumes attached to the server." - ) - __properties: ClassVar[List[str]] = [ - "affinityGroup", - "availabilityZone", - "bootVolume", - "createdAt", - "errorMessage", - "id", - "imageId", - "keypairName", - "labels", - "launchedAt", - "machineType", - "maintenanceWindow", - "name", - "networking", - "nics", - "powerStatus", - "securityGroups", - "serviceAccountMails", - "status", - "updatedAt", - "userData", - "volumes", - ] - - @field_validator("affinity_group") - def affinity_group_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("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("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 - - @field_validator("keypair_name") - def keypair_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@._-]*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9@._-]*$/") - return value - - @field_validator("machine_type") - def machine_type_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") - return value - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+((-|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|\.)[A-Za-z0-9]+)*$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Server 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. - * OpenAPI `readOnly` fields are excluded. - """ - excluded_fields: Set[str] = set( - [ - "created_at", - "error_message", - "id", - "launched_at", - "maintenance_window", - "nics", - "power_status", - "status", - "updated_at", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of boot_volume - if self.boot_volume: - _dict["bootVolume"] = self.boot_volume.to_dict() - # override the default output from pydantic by calling `to_dict()` of maintenance_window - if self.maintenance_window: - _dict["maintenanceWindow"] = self.maintenance_window.to_dict() - # override the default output from pydantic by calling `to_dict()` of networking - if self.networking: - _dict["networking"] = self.networking.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in nics (list) - _items = [] - if self.nics: - for _item in self.nics: - if _item: - _items.append(_item.to_dict()) - _dict["nics"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Server from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "affinityGroup": obj.get("affinityGroup"), - "availabilityZone": obj.get("availabilityZone"), - "bootVolume": BootVolume.from_dict(obj["bootVolume"]) if obj.get("bootVolume") is not None else None, - "createdAt": obj.get("createdAt"), - "errorMessage": obj.get("errorMessage"), - "id": obj.get("id"), - "imageId": obj.get("imageId"), - "keypairName": obj.get("keypairName"), - "labels": obj.get("labels"), - "launchedAt": obj.get("launchedAt"), - "machineType": obj.get("machineType"), - "maintenanceWindow": ( - ServerMaintenance.from_dict(obj["maintenanceWindow"]) - if obj.get("maintenanceWindow") is not None - else None - ), - "name": obj.get("name"), - "networking": ( - CreateServerPayloadNetworking.from_dict(obj["networking"]) - if obj.get("networking") is not None - else None - ), - "nics": ( - [ServerNetwork.from_dict(_item) for _item in obj["nics"]] if obj.get("nics") is not None else None - ), - "powerStatus": obj.get("powerStatus"), - "securityGroups": obj.get("securityGroups"), - "serviceAccountMails": obj.get("serviceAccountMails"), - "status": obj.get("status"), - "updatedAt": obj.get("updatedAt"), - "userData": obj.get("userData"), - "volumes": obj.get("volumes"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/server_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/server_list_response.py deleted file mode 100644 index 51186069..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/server_list_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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.server import Server - - -class ServerListResponse(BaseModel): - """ - Response object for server list request. - """ - - items: List[Server] = Field(description="A list of servers.") - __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 ServerListResponse 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 ServerListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"items": [Server.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/server_maintenance.py b/services/iaasalpha/src/stackit/iaasalpha/models/server_maintenance.py deleted file mode 100644 index 8f38ee50..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/server_maintenance.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - - -class ServerMaintenance(BaseModel): - """ - Object that represents the information about the next planned server maintenance window. - """ - - details: Optional[StrictStr] = None - ends_at: datetime = Field(description="End of the maintenance window.", alias="endsAt") - starts_at: datetime = Field(description="Start of the maintenance window.", alias="startsAt") - status: StrictStr - __properties: ClassVar[List[str]] = ["details", "endsAt", "startsAt", "status"] - - 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 ServerMaintenance 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 ServerMaintenance from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "details": obj.get("details"), - "endsAt": obj.get("endsAt"), - "startsAt": obj.get("startsAt"), - "status": obj.get("status"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/server_network.py b/services/iaasalpha/src/stackit/iaasalpha/models/server_network.py deleted file mode 100644 index f6a52bed..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/server_network.py +++ /dev/null @@ -1,225 +0,0 @@ -# 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.allowed_addresses_inner import AllowedAddressesInner - - -class ServerNetwork(BaseModel): - """ - Describes the object that matches servers to its networks. - """ - - allowed_addresses: Optional[List[AllowedAddressesInner]] = Field( - default=None, description="A list of IPs or CIDR notations.", alias="allowedAddresses" - ) - ipv4: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - ipv6: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="String that represents an IPv6 address." - ) - mac: Annotated[str, Field(strict=True)] = Field(description="Object that represents an MAC address.") - network_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID).", alias="networkId" - ) - network_name: Annotated[str, Field(strict=True, max_length=63)] = Field( - description="The name for a General Object. Matches Names and also UUIDs.", alias="networkName" - ) - nic_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID).", alias="nicId" - ) - nic_security: StrictBool = Field( - description="If this is set to false, then no security groups will apply to this server network interface.", - alias="nicSecurity", - ) - public_ip: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address.", alias="publicIp" - ) - security_groups: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="A list of UUIDs.", alias="securityGroups" - ) - __properties: ClassVar[List[str]] = [ - "allowedAddresses", - "ipv4", - "ipv6", - "mac", - "networkId", - "networkName", - "nicId", - "nicSecurity", - "publicIp", - "securityGroups", - ] - - @field_validator("ipv4") - def ipv4_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("ipv6") - def ipv6_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match( - r"^\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-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("mac") - def mac_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$", value): - raise ValueError(r"must validate the regular expression /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/") - return value - - @field_validator("network_id") - def network_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 - - @field_validator("network_name") - def network_name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") - return value - - @field_validator("nic_id") - def nic_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 - - @field_validator("public_ip") - def public_ip_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 ServerNetwork 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 allowed_addresses (list) - _items = [] - if self.allowed_addresses: - for _item in self.allowed_addresses: - if _item: - _items.append(_item.to_dict()) - _dict["allowedAddresses"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ServerNetwork from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "allowedAddresses": ( - [AllowedAddressesInner.from_dict(_item) for _item in obj["allowedAddresses"]] - if obj.get("allowedAddresses") is not None - else None - ), - "ipv4": obj.get("ipv4"), - "ipv6": obj.get("ipv6"), - "mac": obj.get("mac"), - "networkId": obj.get("networkId"), - "networkName": obj.get("networkName"), - "nicId": obj.get("nicId"), - "nicSecurity": obj.get("nicSecurity"), - "publicIp": obj.get("publicIp"), - "securityGroups": obj.get("securityGroups"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/service_account_mail_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/service_account_mail_list_response.py deleted file mode 100644 index f8536368..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/service_account_mail_list_response.py +++ /dev/null @@ -1,84 +0,0 @@ -# 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 - - -class ServiceAccountMailListResponse(BaseModel): - """ - Service account mail list response. - """ - - items: Annotated[List[Annotated[str, Field(strict=True, max_length=255)]], Field(max_length=1)] = Field( - description="A list of service account mails." - ) - __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 ServiceAccountMailListResponse 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 ServiceAccountMailListResponse 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/set_image_share_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/set_image_share_payload.py deleted file mode 100644 index 426ac32d..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/set_image_share_payload.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 deleted file mode 100644 index e68f1e6e..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/snapshot.py +++ /dev/null @@ -1,162 +0,0 @@ -# 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - status: Optional[StrictStr] = Field( - default=None, - description="The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - 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 deleted file mode 100644 index 6c72e2fc..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/snapshot_list_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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/static_area_id.py b/services/iaasalpha/src/stackit/iaasalpha/models/static_area_id.py deleted file mode 100644 index d188a5f9..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/static_area_id.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 -from enum import Enum - -from typing_extensions import Self - - -class StaticAreaID(str, Enum): - """ - The identifier (ID) of a static area. - """ - - """ - allowed enum values - """ - PUBLIC = "PUBLIC" - SCHWARZ = "SCHWARZ" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of StaticAreaID from a JSON string""" - return cls(json.loads(json_str)) diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_area_address_family.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_area_address_family.py deleted file mode 100644 index 3b7d36f5..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_area_address_family.py +++ /dev/null @@ -1,89 +0,0 @@ -# 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_area_ipv4 import UpdateAreaIPv4 - - -class UpdateAreaAddressFamily(BaseModel): - """ - The addressFamily object for a area update request. - """ - - ipv4: Optional[UpdateAreaIPv4] = None - __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 UpdateAreaAddressFamily 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() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateAreaAddressFamily from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"ipv4": UpdateAreaIPv4.from_dict(obj["ipv4"]) if obj.get("ipv4") is not None else None} - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_area_ipv4.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_area_ipv4.py deleted file mode 100644 index 5bb7e9d7..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_area_ipv4.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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 - - -class UpdateAreaIPv4(BaseModel): - """ - The update object for a IPv4 network area. - """ - - default_nameservers: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=3)]] = Field( - default=None, alias="defaultNameservers" - ) - default_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( - default=None, - description="The default prefix length for networks in the network area.", - alias="defaultPrefixLen", - ) - max_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=24)]] = Field( - default=None, description="The maximal prefix length for networks in the network area.", alias="maxPrefixLen" - ) - min_prefix_len: Optional[Annotated[int, Field(le=29, strict=True, ge=8)]] = Field( - default=None, description="The minimal prefix length for networks in the network area.", alias="minPrefixLen" - ) - __properties: ClassVar[List[str]] = ["defaultNameservers", "defaultPrefixLen", "maxPrefixLen", "minPrefixLen"] - - 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 UpdateAreaIPv4 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 UpdateAreaIPv4 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "defaultNameservers": obj.get("defaultNameservers"), - "defaultPrefixLen": obj.get("defaultPrefixLen"), - "maxPrefixLen": obj.get("maxPrefixLen"), - "minPrefixLen": obj.get("minPrefixLen"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_attached_volume_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_attached_volume_payload.py deleted file mode 100644 index 77bfa87d..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_attached_volume_payload.py +++ /dev/null @@ -1,130 +0,0 @@ -# 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 - - -class UpdateAttachedVolumePayload(BaseModel): - """ - Object that represents a Volume attachment to a server. - """ - - delete_on_termination: Optional[StrictBool] = Field( - default=None, - description="Delete the volume during the termination of the server. Defaults to false.", - alias="deleteOnTermination", - ) - server_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="serverId" - ) - 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]] = ["deleteOnTermination", "serverId", "volumeId"] - - @field_validator("server_id") - def server_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 UpdateAttachedVolumePayload 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( - [ - "server_id", - "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 UpdateAttachedVolumePayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "deleteOnTermination": obj.get("deleteOnTermination"), - "serverId": obj.get("serverId"), - "volumeId": obj.get("volumeId"), - } - ) - 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 deleted file mode 100644 index 5395d23b..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_backup_payload.py +++ /dev/null @@ -1,202 +0,0 @@ -# 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - 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. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - 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_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_image_payload.py deleted file mode 100644 index 1c49679f..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_image_payload.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictInt, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.image_config import ImageConfig - - -class UpdateImagePayload(BaseModel): - """ - Object that represents an update request body of an Image. - """ - - config: Optional[ImageConfig] = None - disk_format: Optional[StrictStr] = Field( - default=None, - description="Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`.", - alias="diskFormat", - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - min_disk_size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.", alias="minDiskSize") - min_ram: Optional[StrictInt] = Field(default=None, description="Size in Megabyte.", alias="minRam") - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - protected: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["config", "diskFormat", "labels", "minDiskSize", "minRam", "name", "protected"] - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateImagePayload from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of config - if self.config: - _dict["config"] = self.config.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateImagePayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "config": ImageConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, - "diskFormat": obj.get("diskFormat"), - "labels": obj.get("labels"), - "minDiskSize": obj.get("minDiskSize"), - "minRam": obj.get("minRam"), - "name": obj.get("name"), - "protected": obj.get("protected"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_image_share_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_image_share_payload.py deleted file mode 100644 index 0baf12ba..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_image_share_payload.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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_key_pair_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_key_pair_payload.py deleted file mode 100644 index 15a06280..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_key_pair_payload.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 - - -class UpdateKeyPairPayload(BaseModel): - """ - Object that represents an update request body of a public key of an SSH keypair. - """ - - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - __properties: ClassVar[List[str]] = ["labels"] - - 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 UpdateKeyPairPayload 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 UpdateKeyPairPayload 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")}) - 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 deleted file mode 100644 index 29becda0..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_network_address_family.py +++ /dev/null @@ -1,97 +0,0 @@ -# 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 index e25eb64a..31024e4d 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv4_body.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv4_body.py @@ -5,53 +5,34 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 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 pydantic import BaseModel, ConfigDict, Field from typing_extensions import Annotated, Self class UpdateNetworkIPv4Body(BaseModel): """ The config object for a IPv4 network update. - """ + """ # noqa: E501 - 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.", - ) + gateway: Optional[object] = None 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, 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 index 45b21bf9..738385ec 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv6_body.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_network_ipv6_body.py @@ -5,53 +5,34 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 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 pydantic import BaseModel, ConfigDict, Field from typing_extensions import Annotated, Self class UpdateNetworkIPv6Body(BaseModel): """ The config object for a IPv6 network update. - """ + """ # noqa: E501 - 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.", - ) + gateway: Optional[object] = None 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, diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_nic_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_nic_payload.py deleted file mode 100644 index d575dc82..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_nic_payload.py +++ /dev/null @@ -1,131 +0,0 @@ -# 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.allowed_addresses_inner import AllowedAddressesInner - - -class UpdateNicPayload(BaseModel): - """ - Object that represents a network interface update. - """ - - allowed_addresses: Optional[List[AllowedAddressesInner]] = Field( - default=None, description="A list of IPs or CIDR notations.", alias="allowedAddresses" - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - nic_security: Optional[StrictBool] = Field( - default=None, - description="If this is set to false, then no security groups will apply to this network interface.", - alias="nicSecurity", - ) - security_groups: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="A list of UUIDs.", alias="securityGroups" - ) - __properties: ClassVar[List[str]] = ["allowedAddresses", "labels", "name", "nicSecurity", "securityGroups"] - - @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 UpdateNicPayload 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 allowed_addresses (list) - _items = [] - if self.allowed_addresses: - for _item in self.allowed_addresses: - if _item: - _items.append(_item.to_dict()) - _dict["allowedAddresses"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateNicPayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "allowedAddresses": ( - [AllowedAddressesInner.from_dict(_item) for _item in obj["allowedAddresses"]] - if obj.get("allowedAddresses") is not None - else None - ), - "labels": obj.get("labels"), - "name": obj.get("name"), - "nicSecurity": obj.get("nicSecurity"), - "securityGroups": obj.get("securityGroups"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_public_ip_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_public_ip_payload.py deleted file mode 100644 index af61e39f..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_public_ip_payload.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 UpdatePublicIPPayload(BaseModel): - """ - Object that represents a public IP. - """ - - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ip: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - network_interface: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, - description="Associate the public IP with a network interface or a virtual IP (ID).", - alias="networkInterface", - ) - __properties: ClassVar[List[str]] = ["id", "ip", "labels", "networkInterface"] - - @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("ip") - def ip_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("network_interface") - def network_interface_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 UpdatePublicIPPayload 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", - "ip", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if network_interface (nullable) is None - # and model_fields_set contains the field - if self.network_interface is None and "network_interface" in self.model_fields_set: - _dict["networkInterface"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdatePublicIPPayload 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"), - "ip": obj.get("ip"), - "labels": obj.get("labels"), - "networkInterface": obj.get("networkInterface"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/v1alpha1_update_route_of_area_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_route_of_routing_table_payload.py similarity index 89% rename from services/iaasalpha/src/stackit/iaasalpha/models/v1alpha1_update_route_of_area_payload.py rename to services/iaasalpha/src/stackit/iaasalpha/models/update_route_of_routing_table_payload.py index d27775b5..019ca7af 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/v1alpha1_update_route_of_area_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_route_of_routing_table_payload.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations @@ -22,10 +22,10 @@ from typing_extensions import Self -class V1alpha1UpdateRouteOfAreaPayload(BaseModel): +class UpdateRouteOfRoutingTablePayload(BaseModel): """ Object that represents the request body for a route update. - """ + """ # noqa: E501 labels: Optional[Dict[str, Any]] = Field( default=None, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of V1alpha1UpdateRouteOfAreaPayload from a JSON string""" + """Create an instance of UpdateRouteOfRoutingTablePayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of V1alpha1UpdateRouteOfAreaPayload from a dict""" + """Create an instance of UpdateRouteOfRoutingTablePayload from a dict""" if obj is None: return None diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_security_group_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_routing_table_of_area_payload.py similarity index 85% rename from services/iaasalpha/src/stackit/iaasalpha/models/update_security_group_payload.py rename to services/iaasalpha/src/stackit/iaasalpha/models/update_routing_table_of_area_payload.py index 4613dfc7..71eefe6a 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_security_group_payload.py +++ b/services/iaasalpha/src/stackit/iaasalpha/models/update_routing_table_of_area_payload.py @@ -5,28 +5,28 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator from typing_extensions import Annotated, Self -class UpdateSecurityGroupPayload(BaseModel): - """ - Object that represents an update request body of a security group. +class UpdateRoutingTableOfAreaPayload(BaseModel): """ + Object that represents the request body for a routing table update. + """ # noqa: E501 description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="Description Object. Allows string up to 255 Characters." @@ -35,7 +35,7 @@ class UpdateSecurityGroupPayload(BaseModel): default=None, description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( + name: Optional[Annotated[str, Field(strict=True, max_length=127)]] = Field( default=None, description="The name for a General Object. Matches Names and also UUIDs." ) __properties: ClassVar[List[str]] = ["description", "labels", "name"] @@ -46,8 +46,8 @@ def name_validate_regular_expression(cls, value): if value is None: return value - if not re.match(r"^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|_|\s|\.)[A-Za-z0-9]+)*$/") + if not re.match(r"^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$", value): + raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+([ \/._-]*[A-Za-z0-9]+)*$/") return value model_config = ConfigDict( @@ -67,7 +67,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateSecurityGroupPayload from a JSON string""" + """Create an instance of UpdateRoutingTableOfAreaPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -91,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateSecurityGroupPayload from a dict""" + """Create an instance of UpdateRoutingTableOfAreaPayload from a dict""" if obj is None: return None diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/update_server_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_server_payload.py deleted file mode 100644 index aa9f10ec..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_server_payload.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 UpdateServerPayload(BaseModel): - """ - Object that represents an update request body of a server. - """ - - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a Server." - ) - __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]+((-|\.)[A-Za-z0-9]+)*$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9]+((-|\.)[A-Za-z0-9]+)*$/") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateServerPayload 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 UpdateServerPayload 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_snapshot_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_snapshot_payload.py deleted file mode 100644 index 3b53d543..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_snapshot_payload.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - __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_virtual_ip_payload.py b/services/iaasalpha/src/stackit/iaasalpha/models/update_virtual_ip_payload.py deleted file mode 100644 index 207fdb17..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_virtual_ip_payload.py +++ /dev/null @@ -1,107 +0,0 @@ -# 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 UpdateVirtualIPPayload(BaseModel): - """ - Object that represents a virtual IP update request body. - """ - - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - members: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="A list of UUIDs." - ) - 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", "members", "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 UpdateVirtualIPPayload 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 members (nullable) is None - # and model_fields_set contains the field - if self.members is None and "members" in self.model_fields_set: - _dict["members"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateVirtualIPPayload 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"), "members": obj.get("members"), "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 deleted file mode 100644 index f524ac2e..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/update_volume_payload.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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.image_config import ImageConfig - - -class UpdateVolumePayload(BaseModel): - """ - Object that represents an update request body of a volume. - """ - - bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") - description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( - default=None, description="Description Object. Allows string up to 255 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - __properties: ClassVar[List[str]] = ["bootable", "description", "imageConfig", "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 UpdateVolumePayload 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 image_config - if self.image_config: - _dict["imageConfig"] = self.image_config.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateVolumePayload from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "bootable": obj.get("bootable"), - "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"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/virtual_ip.py b/services/iaasalpha/src/stackit/iaasalpha/models/virtual_ip.py deleted file mode 100644 index 606ee500..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/virtual_ip.py +++ /dev/null @@ -1,173 +0,0 @@ -# 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 VirtualIp(BaseModel): - """ - Object that represents a virtual IP. - """ - - id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - ip: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, description="Object that represents an IP address." - ) - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - members: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field( - default=None, description="A list of UUIDs." - ) - 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." - ) - network: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID)." - ) - status: Optional[StrictStr] = Field( - default=None, - description="The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`.", - ) - __properties: ClassVar[List[str]] = ["id", "ip", "labels", "members", "name", "network", "status"] - - @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("ip") - def ip_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("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("network") - def network_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 VirtualIp 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. - """ - excluded_fields: Set[str] = set( - [ - "id", - "network", - "status", - ] - ) - - _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 VirtualIp 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"), - "ip": obj.get("ip"), - "labels": obj.get("labels"), - "members": obj.get("members"), - "name": obj.get("name"), - "network": obj.get("network"), - "status": obj.get("status"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/virtual_ip_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/virtual_ip_list_response.py deleted file mode 100644 index 350a5e80..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/virtual_ip_list_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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.virtual_ip import VirtualIp - - -class VirtualIpListResponse(BaseModel): - """ - Virtual IPs list response. - """ - - items: List[VirtualIp] = Field(description="A list of virtual IPs.") - __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 VirtualIpListResponse 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 VirtualIpListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"items": [VirtualIp.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/volume.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume.py deleted file mode 100644 index 108cc2ec..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume.py +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictInt, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from stackit.iaasalpha.models.image_config import ImageConfig -from stackit.iaasalpha.models.volume_source import VolumeSource - - -class Volume(BaseModel): - """ - Object that represents a volume and its parameters. Used for Creating and returning (get/list). - """ - - availability_zone: StrictStr = Field( - description="Object that represents an availability zone.", alias="availabilityZone" - ) - bootable: Optional[StrictBool] = Field(default=None, description="Indicates if a volume is bootable.") - created_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was created.", alias="createdAt" - ) - description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( - default=None, description="Description Object. Allows string up to 255 Characters." - ) - 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. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, description="The name for a General Object. Matches Names and also UUIDs." - ) - performance_class: Optional[Annotated[str, Field(strict=True, max_length=63)]] = Field( - default=None, - description="The name for a General Object. Matches Names and also UUIDs.", - alias="performanceClass", - ) - server_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="serverId" - ) - size: Optional[StrictInt] = Field(default=None, description="Size in Gigabyte.") - source: Optional[VolumeSource] = None - status: Optional[StrictStr] = Field( - default=None, - description="The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`.", - ) - updated_at: Optional[datetime] = Field( - default=None, description="Date-time when resource was last updated.", alias="updatedAt" - ) - __properties: ClassVar[List[str]] = [ - "availabilityZone", - "bootable", - "createdAt", - "description", - "id", - "imageConfig", - "labels", - "name", - "performanceClass", - "serverId", - "size", - "source", - "status", - "updatedAt", - ] - - @field_validator("id") - def id_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): - raise ValueError( - r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" - ) - return value - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if 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("performance_class") - def performance_class_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("server_id") - def server_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 Volume 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. - """ - excluded_fields: Set[str] = set( - [ - "created_at", - "id", - "image_config", - "server_id", - "status", - "updated_at", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of 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() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Volume 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"), - "bootable": obj.get("bootable"), - "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"), - "serverId": obj.get("serverId"), - "size": obj.get("size"), - "source": VolumeSource.from_dict(obj["source"]) if obj.get("source") is not None else None, - "status": obj.get("status"), - "updatedAt": obj.get("updatedAt"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/volume_attachment.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume_attachment.py deleted file mode 100644 index b2363b59..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume_attachment.py +++ /dev/null @@ -1,130 +0,0 @@ -# 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 - - -class VolumeAttachment(BaseModel): - """ - Object that represents a Volume attachment to a server. - """ - - delete_on_termination: Optional[StrictBool] = Field( - default=None, - description="Delete the volume during the termination of the server. Defaults to false.", - alias="deleteOnTermination", - ) - server_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field( - default=None, description="Universally Unique Identifier (UUID).", alias="serverId" - ) - 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]] = ["deleteOnTermination", "serverId", "volumeId"] - - @field_validator("server_id") - def server_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 VolumeAttachment 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( - [ - "server_id", - "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 VolumeAttachment from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "deleteOnTermination": obj.get("deleteOnTermination"), - "serverId": obj.get("serverId"), - "volumeId": obj.get("volumeId"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/volume_attachment_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume_attachment_list_response.py deleted file mode 100644 index 15aeaece..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume_attachment_list_response.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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.volume_attachment import VolumeAttachment - - -class VolumeAttachmentListResponse(BaseModel): - """ - Volume attachment list response. - """ - - items: List[VolumeAttachment] = Field(description="A list containing Volume attachments of a server.") - __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 VolumeAttachmentListResponse 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 VolumeAttachmentListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "items": ( - [VolumeAttachment.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/volume_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume_list_response.py deleted file mode 100644 index b87d9cdf..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume_list_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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.volume import Volume - - -class VolumeListResponse(BaseModel): - """ - Volume list response. - """ - - items: List[Volume] = Field(description="A list containing volume 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 VolumeListResponse 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 VolumeListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"items": [Volume.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/volume_performance_class.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class.py deleted file mode 100644 index e734ac46..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - IaaS-API - - This API allows you to create and modify IaaS resources. - - The version of the OpenAPI document: 1alpha1 - Contact: stackit-iaas@mail.schwarz - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -import re -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator -from typing_extensions import Annotated, Self - - -class VolumePerformanceClass(BaseModel): - """ - Object that represents a Volume performance class. - """ - - description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( - default=None, description="Description Object. Allows string up to 255 Characters." - ) - iops: Optional[StrictInt] = Field(default=None, description="Input/Output Operations per second.") - labels: Optional[Dict[str, Any]] = Field( - default=None, - description="Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`.", - ) - name: Annotated[str, Field(strict=True, max_length=63)] = Field( - description="The name for a General Object. Matches Names and also UUIDs." - ) - throughput: Optional[StrictInt] = Field(default=None, description="Throughput in Megabyte per second.") - __properties: ClassVar[List[str]] = ["description", "iops", "labels", "name", "throughput"] - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """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 VolumePerformanceClass 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 VolumePerformanceClass from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "description": obj.get("description"), - "iops": obj.get("iops"), - "labels": obj.get("labels"), - "name": obj.get("name"), - "throughput": obj.get("throughput"), - } - ) - return _obj diff --git a/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class_list_response.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class_list_response.py deleted file mode 100644 index 20749c69..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume_performance_class_list_response.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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.volume_performance_class import VolumePerformanceClass - - -class VolumePerformanceClassListResponse(BaseModel): - """ - Volume performance class list response. - """ - - items: List[VolumePerformanceClass] = Field(description="A list containing Volume performance classes.") - __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 VolumePerformanceClassListResponse 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 VolumePerformanceClassListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "items": ( - [VolumePerformanceClass.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/volume_source.py b/services/iaasalpha/src/stackit/iaasalpha/models/volume_source.py deleted file mode 100644 index 2f1749f3..00000000 --- a/services/iaasalpha/src/stackit/iaasalpha/models/volume_source.py +++ /dev/null @@ -1,97 +0,0 @@ -# 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 VolumeSource(BaseModel): - """ - The source object of a volume. - """ - - id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="Universally Unique Identifier (UUID)." - ) - type: StrictStr = Field( - description="The source types of a volume. Possible values: `image`, `volume`, `snapshot`, `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 VolumeSource 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 VolumeSource 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/rest.py b/services/iaasalpha/src/stackit/iaasalpha/rest.py index ad3e0ec3..dc66acbd 100644 --- a/services/iaasalpha/src/stackit/iaasalpha/rest.py +++ b/services/iaasalpha/src/stackit/iaasalpha/rest.py @@ -5,12 +5,12 @@ This API allows you to create and modify IaaS resources. - The version of the OpenAPI document: 1alpha1 + The version of the OpenAPI document: 2alpha1 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 +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: