Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3832,6 +3832,8 @@ async def list_private_ni_cs(
"""
List all private NICs.
List all private NICs of a specified Instance.
Some private NICs, such as those in deleting, detaching, or in error state are
not listed. We strongly recommend migrating to v2alpha1 to retrieve all private NICs.
:param server_id: Instance to which the private NIC is attached.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param tags: Private NIC tags.
Expand Down Expand Up @@ -3875,6 +3877,8 @@ async def list_private_ni_cs_all(
"""
List all private NICs.
List all private NICs of a specified Instance.
Some private NICs, such as those in deleting, detaching, or in error state are
not listed. We strongly recommend migrating to v2alpha1 to retrieve all private NICs.
:param server_id: Instance to which the private NIC is attached.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param tags: Private NIC tags.
Expand Down Expand Up @@ -3915,6 +3919,12 @@ async def create_private_nic(
) -> CreatePrivateNICResponse:
"""
Create a private NIC connecting an Instance to a Private Network.
Create a private NIC connecting an Instance to a Private Network.
Some private NICs, such as those in deleting, detaching, or in error state are
not listed in v1.
Therefore, you may encounter quota limits errors when creating a new private NIC, even if your visible
count is below the threshold.
We strongly recommend migrating to v2alpha1 to see all private NICs.
:param server_id: UUID of the Instance the private NIC will be attached to.
:param private_network_id: UUID of the private network where the private NIC will be attached.
:param zone: Zone to target. If none is passed will use default zone from the config.
Expand Down
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/instance/v2alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
from .types import DeleteTemplateRequest
from .types import DeleteTemplateUserDataRequest
from .types import DeleteUserDataRequest
from .types import DetachAndDeletePrivateNetworkInterfaceRequest
from .types import DetachServerFileSystemRequest
from .types import DetachServerIPRequest
from .types import DetachServerPrivateNetworkInterfaceRequest
Expand Down Expand Up @@ -250,6 +251,7 @@
"DeleteTemplateRequest",
"DeleteTemplateUserDataRequest",
"DeleteUserDataRequest",
"DetachAndDeletePrivateNetworkInterfaceRequest",
"DetachServerFileSystemRequest",
"DetachServerIPRequest",
"DetachServerPrivateNetworkInterfaceRequest",
Expand Down
37 changes: 35 additions & 2 deletions scaleway-async/scaleway_async/instance/v2alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ async def delete_server(
One-Of ('ips'): at most one of 'delete_all_ips', 'delete_ip_ids' could be set.
:param delete_ip_ids: List of IP IDs to delete.
One-Of ('ips'): at most one of 'delete_all_ips', 'delete_ip_ids' could be set.
:param delete_all_volumes: Whether to delete all volumes attached to the server.
:param delete_all_volumes: Whether to delete all volumes attached to the server. Deletion of SBS volumes is not supported yet.
One-Of ('volumes'): at most one of 'delete_all_volumes', 'delete_volume_ids' could be set.
:param delete_volume_ids: List of volume IDs to delete.
:param delete_volume_ids: List of volume IDs to delete. Deletion of SBS volumes is not supported yet.
One-Of ('volumes'): at most one of 'delete_all_volumes', 'delete_volume_ids' could be set.
:param keep_all_private_nics: Whether to keep all private network interfaces.
One-Of ('private_nics'): at most one of 'keep_all_private_nics', 'delete_private_nic_ids' could be set.
Expand Down Expand Up @@ -1420,6 +1420,39 @@ async def delete_private_network_interface(

self._throw_on_error(res)

async def detach_and_delete_private_network_interface(
self,
*,
private_network_interface_id: str,
zone: Optional[ScwZone] = None,
) -> PrivateNetworkInterface:
"""
:param private_network_interface_id: ID of the private network interface to detach and delete.
:param zone: Zone to target. If none is passed will use default zone from the config.
:return: :class:`PrivateNetworkInterface <PrivateNetworkInterface>`

Usage:
::

result = await api.detach_and_delete_private_network_interface(
private_network_interface_id="example",
)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
param_private_network_interface_id = validate_path_param(
"private_network_interface_id", private_network_interface_id
)

res = self._request(
"POST",
f"/instance/v2alpha1/zones/{param_zone}/private-network-interfaces/{param_private_network_interface_id}/detach-and-delete",
body={},
)

self._throw_on_error(res)
return unmarshal_PrivateNetworkInterface(res.json())

async def list_placement_groups(
self,
*,
Expand Down
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/instance/v2alpha1/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
PrivateNetworkInterfaceStatus.ATTACHING,
PrivateNetworkInterfaceStatus.DETACHING,
PrivateNetworkInterfaceStatus.SYNCING,
PrivateNetworkInterfaceStatus.DELETING,
]
"""
Lists transient statutes of the enum :class:`PrivateNetworkInterfaceStatus <PrivateNetworkInterfaceStatus>`.
Expand All @@ -39,6 +40,7 @@
ServerPrivateNetworkInterfaceStatus.ATTACHING,
ServerPrivateNetworkInterfaceStatus.DETACHING,
ServerPrivateNetworkInterfaceStatus.SYNCING,
ServerPrivateNetworkInterfaceStatus.DELETING,
]
"""
Lists transient statutes of the enum :class:`ServerPrivateNetworkInterfaceStatus <ServerPrivateNetworkInterfaceStatus>`.
Expand Down
19 changes: 19 additions & 0 deletions scaleway-async/scaleway_async/instance/v2alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class PrivateNetworkInterfaceStatus(str, Enum, metaclass=StrEnumMeta):
ATTACHING = "attaching"
DETACHING = "detaching"
SYNCING = "syncing"
DELETING = "deleting"
DETACH_ERROR = "detach_error"
DELETE_ERROR = "delete_error"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -208,6 +211,9 @@ class ServerPrivateNetworkInterfaceStatus(str, Enum, metaclass=StrEnumMeta):
ATTACHING = "attaching"
DETACHING = "detaching"
SYNCING = "syncing"
DELETING = "deleting"
DETACH_ERROR = "detach_error"
DELETE_ERROR = "delete_error"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -1756,6 +1762,19 @@ class DeleteUserDataRequest:
"""


@dataclass
class DetachAndDeletePrivateNetworkInterfaceRequest:
private_network_interface_id: str
"""
ID of the private network interface to detach and delete.
"""

zone: Optional[ScwZone] = None
"""
Zone to target. If none is passed will use default zone from the config.
"""


@dataclass
class DetachServerFileSystemRequest:
server_id: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .types import DataKeyAlgorithmSymmetricEncryption
from .types import KeyAlgorithmAsymmetricEncryption
from .types import KeyAlgorithmAsymmetricSigning
from .types import KeyAlgorithmKeyEncapsulation
from .types import KeyAlgorithmSymmetricEncryption
from .types import KeyOrigin
from .types import KeyState
Expand Down Expand Up @@ -51,6 +52,7 @@
"DataKeyAlgorithmSymmetricEncryption",
"KeyAlgorithmAsymmetricEncryption",
"KeyAlgorithmAsymmetricSigning",
"KeyAlgorithmKeyEncapsulation",
"KeyAlgorithmSymmetricEncryption",
"KeyOrigin",
"KeyState",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ def unmarshal_KeyUsage(data: Any) -> KeyUsage:
KeyAlgorithmAsymmetricSigning.UNKNOWN_ASYMMETRIC_SIGNING
)

field = data.get("key_encapsulation", None)
if field is not None:
args["key_encapsulation"] = field
else:
args["key_encapsulation"] = None

return KeyUsage(**args)


Expand Down Expand Up @@ -535,6 +541,11 @@ def marshal_KeyUsage(
value=request.asymmetric_signing,
marshal_func=None,
),
OneOfPossibility(
param="key_encapsulation",
value=request.key_encapsulation,
marshal_func=None,
),
]
),
)
Expand Down
15 changes: 13 additions & 2 deletions scaleway-async/scaleway_async/key_manager/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class KeyAlgorithmAsymmetricEncryption(str, Enum, metaclass=StrEnumMeta):
RSA_OAEP_2048_SHA256 = "rsa_oaep_2048_sha256"
RSA_OAEP_3072_SHA256 = "rsa_oaep_3072_sha256"
RSA_OAEP_4096_SHA256 = "rsa_oaep_4096_sha256"
ML_KEM_768 = "ml_kem_768"
ML_KEM_1024 = "ml_kem_1024"

def __str__(self) -> str:
return str(self.value)
Expand All @@ -48,6 +46,16 @@ class KeyAlgorithmAsymmetricSigning(str, Enum, metaclass=StrEnumMeta):
ML_DSA_44 = "ml_dsa_44"
ML_DSA_65 = "ml_dsa_65"
ML_DSA_87 = "ml_dsa_87"
EC_SECP256K1_SHA256 = "ec_secp256k1_sha256"

def __str__(self) -> str:
return str(self.value)


class KeyAlgorithmKeyEncapsulation(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_KEY_ENCAPSULATION = "unknown_key_encapsulation"
ML_KEM_768 = "ml_kem_768"
ML_KEM_1024 = "ml_kem_1024"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -86,6 +94,7 @@ class ListAlgorithmsRequestUsage(str, Enum, metaclass=StrEnumMeta):
SYMMETRIC_ENCRYPTION = "symmetric_encryption"
ASYMMETRIC_ENCRYPTION = "asymmetric_encryption"
ASYMMETRIC_SIGNING = "asymmetric_signing"
KEY_ENCAPSULATION = "key_encapsulation"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -140,6 +149,8 @@ class KeyUsage:
KeyAlgorithmAsymmetricSigning.UNKNOWN_ASYMMETRIC_SIGNING
)

key_encapsulation: Optional[KeyAlgorithmKeyEncapsulation] = None


@dataclass
class ListAlgorithmsResponseAlgorithm:
Expand Down
10 changes: 10 additions & 0 deletions scaleway/scaleway/instance/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3832,6 +3832,8 @@ def list_private_ni_cs(
"""
List all private NICs.
List all private NICs of a specified Instance.
Some private NICs, such as those in deleting, detaching, or in error state are
not listed. We strongly recommend migrating to v2alpha1 to retrieve all private NICs.
:param server_id: Instance to which the private NIC is attached.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param tags: Private NIC tags.
Expand Down Expand Up @@ -3875,6 +3877,8 @@ def list_private_ni_cs_all(
"""
List all private NICs.
List all private NICs of a specified Instance.
Some private NICs, such as those in deleting, detaching, or in error state are
not listed. We strongly recommend migrating to v2alpha1 to retrieve all private NICs.
:param server_id: Instance to which the private NIC is attached.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param tags: Private NIC tags.
Expand Down Expand Up @@ -3915,6 +3919,12 @@ def create_private_nic(
) -> CreatePrivateNICResponse:
"""
Create a private NIC connecting an Instance to a Private Network.
Create a private NIC connecting an Instance to a Private Network.
Some private NICs, such as those in deleting, detaching, or in error state are
not listed in v1.
Therefore, you may encounter quota limits errors when creating a new private NIC, even if your visible
count is below the threshold.
We strongly recommend migrating to v2alpha1 to see all private NICs.
:param server_id: UUID of the Instance the private NIC will be attached to.
:param private_network_id: UUID of the private network where the private NIC will be attached.
:param zone: Zone to target. If none is passed will use default zone from the config.
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/instance/v2alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
from .types import DeleteTemplateRequest
from .types import DeleteTemplateUserDataRequest
from .types import DeleteUserDataRequest
from .types import DetachAndDeletePrivateNetworkInterfaceRequest
from .types import DetachServerFileSystemRequest
from .types import DetachServerIPRequest
from .types import DetachServerPrivateNetworkInterfaceRequest
Expand Down Expand Up @@ -250,6 +251,7 @@
"DeleteTemplateRequest",
"DeleteTemplateUserDataRequest",
"DeleteUserDataRequest",
"DetachAndDeletePrivateNetworkInterfaceRequest",
"DetachServerFileSystemRequest",
"DetachServerIPRequest",
"DetachServerPrivateNetworkInterfaceRequest",
Expand Down
37 changes: 35 additions & 2 deletions scaleway/scaleway/instance/v2alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ def delete_server(
One-Of ('ips'): at most one of 'delete_all_ips', 'delete_ip_ids' could be set.
:param delete_ip_ids: List of IP IDs to delete.
One-Of ('ips'): at most one of 'delete_all_ips', 'delete_ip_ids' could be set.
:param delete_all_volumes: Whether to delete all volumes attached to the server.
:param delete_all_volumes: Whether to delete all volumes attached to the server. Deletion of SBS volumes is not supported yet.
One-Of ('volumes'): at most one of 'delete_all_volumes', 'delete_volume_ids' could be set.
:param delete_volume_ids: List of volume IDs to delete.
:param delete_volume_ids: List of volume IDs to delete. Deletion of SBS volumes is not supported yet.
One-Of ('volumes'): at most one of 'delete_all_volumes', 'delete_volume_ids' could be set.
:param keep_all_private_nics: Whether to keep all private network interfaces.
One-Of ('private_nics'): at most one of 'keep_all_private_nics', 'delete_private_nic_ids' could be set.
Expand Down Expand Up @@ -1418,6 +1418,39 @@ def delete_private_network_interface(

self._throw_on_error(res)

def detach_and_delete_private_network_interface(
self,
*,
private_network_interface_id: str,
zone: Optional[ScwZone] = None,
) -> PrivateNetworkInterface:
"""
:param private_network_interface_id: ID of the private network interface to detach and delete.
:param zone: Zone to target. If none is passed will use default zone from the config.
:return: :class:`PrivateNetworkInterface <PrivateNetworkInterface>`

Usage:
::

result = api.detach_and_delete_private_network_interface(
private_network_interface_id="example",
)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
param_private_network_interface_id = validate_path_param(
"private_network_interface_id", private_network_interface_id
)

res = self._request(
"POST",
f"/instance/v2alpha1/zones/{param_zone}/private-network-interfaces/{param_private_network_interface_id}/detach-and-delete",
body={},
)

self._throw_on_error(res)
return unmarshal_PrivateNetworkInterface(res.json())

def list_placement_groups(
self,
*,
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/instance/v2alpha1/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
PrivateNetworkInterfaceStatus.ATTACHING,
PrivateNetworkInterfaceStatus.DETACHING,
PrivateNetworkInterfaceStatus.SYNCING,
PrivateNetworkInterfaceStatus.DELETING,
]
"""
Lists transient statutes of the enum :class:`PrivateNetworkInterfaceStatus <PrivateNetworkInterfaceStatus>`.
Expand All @@ -39,6 +40,7 @@
ServerPrivateNetworkInterfaceStatus.ATTACHING,
ServerPrivateNetworkInterfaceStatus.DETACHING,
ServerPrivateNetworkInterfaceStatus.SYNCING,
ServerPrivateNetworkInterfaceStatus.DELETING,
]
"""
Lists transient statutes of the enum :class:`ServerPrivateNetworkInterfaceStatus <ServerPrivateNetworkInterfaceStatus>`.
Expand Down
19 changes: 19 additions & 0 deletions scaleway/scaleway/instance/v2alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class PrivateNetworkInterfaceStatus(str, Enum, metaclass=StrEnumMeta):
ATTACHING = "attaching"
DETACHING = "detaching"
SYNCING = "syncing"
DELETING = "deleting"
DETACH_ERROR = "detach_error"
DELETE_ERROR = "delete_error"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -208,6 +211,9 @@ class ServerPrivateNetworkInterfaceStatus(str, Enum, metaclass=StrEnumMeta):
ATTACHING = "attaching"
DETACHING = "detaching"
SYNCING = "syncing"
DELETING = "deleting"
DETACH_ERROR = "detach_error"
DELETE_ERROR = "delete_error"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -1756,6 +1762,19 @@ class DeleteUserDataRequest:
"""


@dataclass
class DetachAndDeletePrivateNetworkInterfaceRequest:
private_network_interface_id: str
"""
ID of the private network interface to detach and delete.
"""

zone: Optional[ScwZone] = None
"""
Zone to target. If none is passed will use default zone from the config.
"""


@dataclass
class DetachServerFileSystemRequest:
server_id: str
Expand Down
Loading
Loading