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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.
from .types import Action
from .types import AlertRuleStatus
from .content import ALERT_RULE_TRANSIENT_STATUSES
from .types import AuthenticationEventFailureReason
Expand Down Expand Up @@ -128,6 +129,7 @@
from .api import AuditTrailV1Alpha1API

__all__ = [
"Action",
"AlertRuleStatus",
"ALERT_RULE_TRANSIENT_STATUSES",
"AuthenticationEventFailureReason",
Expand Down
12 changes: 11 additions & 1 deletion scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
)


class Action(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_ACTION = "unknown_action"
CREATE = "create"
UPDATE = "update"
DELETE = "delete"

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


class AlertRuleStatus(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_STATUS = "unknown_status"
ENABLED = "enabled"
Expand Down Expand Up @@ -627,7 +637,7 @@ class Resource:
updated_at: Optional[datetime] = None
deleted_at: Optional[datetime] = None
name: Optional[str] = None
action: Optional[str] = None
action: Optional[Action] = None
secm_secret_info: Optional[SecretManagerSecretInfo] = None

secm_secret_version_info: Optional[SecretManagerSecretVersionInfo] = None
Expand Down
4 changes: 4 additions & 0 deletions scaleway-async/scaleway_async/domain/v2beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,7 @@ async def buy_domains(
*,
domains: list[str],
duration_in_years: int,
auto_renew: bool,
project_id: Optional[str] = None,
owner_contact_id: Optional[str] = None,
owner_contact: Optional[NewContact] = None,
Expand All @@ -1628,6 +1629,7 @@ async def buy_domains(
You can provide a domain's already existing contact or a new contact.
:param domains:
:param duration_in_years:
:param auto_renew: Enable the `auto renew` feature for all the requested domains. This means the domain will be automatically renewed before its expiry date.
:param project_id:
:param owner_contact_id:
One-Of ('owner_contact_type'): at most one of 'owner_contact_id', 'owner_contact' could be set.
Expand All @@ -1649,6 +1651,7 @@ async def buy_domains(
result = await api.buy_domains(
domains=[],
duration_in_years=1,
auto_renew=False,
)
"""

Expand All @@ -1659,6 +1662,7 @@ async def buy_domains(
RegistrarApiBuyDomainsRequest(
domains=domains,
duration_in_years=duration_in_years,
auto_renew=auto_renew,
project_id=project_id,
owner_contact_id=owner_contact_id,
owner_contact=owner_contact,
Expand Down
3 changes: 3 additions & 0 deletions scaleway-async/scaleway_async/domain/v2beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3229,6 +3229,9 @@ def marshal_RegistrarApiBuyDomainsRequest(
if request.duration_in_years is not None:
output["duration_in_years"] = request.duration_in_years

if request.auto_renew is not None:
output["auto_renew"] = request.auto_renew

if request.project_id is not None:
output["project_id"] = request.project_id
else:
Expand Down
5 changes: 5 additions & 0 deletions scaleway-async/scaleway_async/domain/v2beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,11 @@ class RegisterExternalDomainResponse:
class RegistrarApiBuyDomainsRequest:
domains: list[str]
duration_in_years: int
auto_renew: bool
"""
Enable the `auto renew` feature for all the requested domains. This means the domain will be automatically renewed before its expiry date.
"""

project_id: Optional[str] = None
owner_contact_id: Optional[str] = None

Expand Down
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
33 changes: 33 additions & 0 deletions scaleway-async/scaleway_async/instance/v2alpha1/api.py
Original file line number Diff line number Diff line change
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
24 changes: 24 additions & 0 deletions scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,12 @@ def unmarshal_PrivateNetworkInterfaceSummary(
else:
args["tags"] = []

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

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand Down Expand Up @@ -767,6 +773,12 @@ def unmarshal_SecurityGroupSummary(data: Any) -> SecurityGroupSummary:
else:
args["stateless"] = False

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

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand Down Expand Up @@ -1067,6 +1079,12 @@ def unmarshal_ServerSummary(data: Any) -> ServerSummary:
else:
args["rescue_mode"] = False

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

field = data.get("placement_group_id", None)
if field is not None:
args["placement_group_id"] = field
Expand Down Expand Up @@ -1483,6 +1501,12 @@ def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface:
else:
args["tags"] = []

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

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand Down
39 changes: 39 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 @@ -767,6 +773,11 @@ class PrivateNetworkInterfaceSummary:
Tags associated with the private network interface.
"""

zone: ScwZone
"""
Zone in which the network interface is located.
"""

created_at: Optional[datetime] = None
"""
Creation timestamp of the private network interface.
Expand Down Expand Up @@ -830,6 +841,11 @@ class SecurityGroupSummary:
True if the security group is stateless.
"""

zone: ScwZone
"""
Zone in which the security group is located.
"""

created_at: Optional[datetime] = None
"""
Creation timestamp of the security group.
Expand Down Expand Up @@ -931,6 +947,11 @@ class ServerSummary:
Whether the server is in rescue mode.
"""

zone: ScwZone
"""
Zone in which the server is located.
"""

placement_group_id: Optional[str] = None
"""
ID of the placement group the server belongs to.
Expand Down Expand Up @@ -1756,6 +1777,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 Expand Up @@ -2549,6 +2583,11 @@ class PrivateNetworkInterface:
Tags associated with the private network interface.
"""

zone: ScwZone
"""
Zone in which the network interface is located.
"""

created_at: Optional[datetime] = None
"""
Creation timestamp of the private network interface.
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
Loading
Loading