From 7d521eb7697e088b07480b9f9e7418a6d1d92244 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 23 Oct 2026 16:00:14 +0000 Subject: [PATCH] feat: update generated APIs --- .../audit_trail/v1alpha1/__init__.py | 2 + .../audit_trail/v1alpha1/api.py | 84 +++++++++++- .../audit_trail/v1alpha1/marshalling.py | 12 ++ .../audit_trail/v1alpha1/types.py | 23 ++++ .../scaleway_async/cockpit/v1/marshalling.py | 54 ++++++-- .../scaleway_async/cockpit/v1/types.py | 30 +++++ .../iam/v1alpha1/marshalling.py | 15 ++- .../scaleway_async/iam/v1alpha1/types.py | 14 +- .../scaleway_async/instance/v1/api.py | 22 +++ .../scaleway_async/instance/v1/types.py | 4 + .../scaleway_async/instance/v2alpha1/api.py | 9 ++ .../instance/v2alpha1/marshalling.py | 27 ++++ .../scaleway_async/instance/v2alpha1/types.py | 30 +++++ .../scaleway_async/kafka/v1alpha1/api.py | 3 + .../kafka/v1alpha1/marshalling.py | 3 + .../scaleway_async/kafka/v1alpha1/types.py | 5 + .../scaleway_async/lb/v1/marshalling.py | 126 +++++++++++++++--- scaleway-async/scaleway_async/lb/v1/types.py | 75 +++++++++++ .../scaleway_async/partner/v1/marshalling.py | 6 + .../scaleway_async/partner/v1/types.py | 5 + .../scaleway/audit_trail/v1alpha1/__init__.py | 2 + scaleway/scaleway/audit_trail/v1alpha1/api.py | 80 +++++++++++ .../audit_trail/v1alpha1/marshalling.py | 12 ++ .../scaleway/audit_trail/v1alpha1/types.py | 23 ++++ scaleway/scaleway/cockpit/v1/marshalling.py | 54 ++++++-- scaleway/scaleway/cockpit/v1/types.py | 30 +++++ scaleway/scaleway/iam/v1alpha1/marshalling.py | 15 ++- scaleway/scaleway/iam/v1alpha1/types.py | 14 +- scaleway/scaleway/instance/v1/api.py | 22 +++ scaleway/scaleway/instance/v1/types.py | 4 + scaleway/scaleway/instance/v2alpha1/api.py | 9 ++ .../scaleway/instance/v2alpha1/marshalling.py | 27 ++++ scaleway/scaleway/instance/v2alpha1/types.py | 30 +++++ scaleway/scaleway/kafka/v1alpha1/api.py | 3 + .../scaleway/kafka/v1alpha1/marshalling.py | 3 + scaleway/scaleway/kafka/v1alpha1/types.py | 5 + scaleway/scaleway/lb/v1/marshalling.py | 126 +++++++++++++++--- scaleway/scaleway/lb/v1/types.py | 75 +++++++++++ scaleway/scaleway/partner/v1/marshalling.py | 6 + scaleway/scaleway/partner/v1/types.py | 5 + 40 files changed, 1029 insertions(+), 65 deletions(-) diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py index 7714e6e3d..3f2fb4441 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py @@ -115,6 +115,7 @@ from .types import EnableCustomAlertRulesRequest from .types import EnableCustomAlertRulesResponse from .types import EventsOverview +from .types import GetCustomAlertRuleRequest from .types import GetLastEventsOverviewRequest from .types import ListAlertRulesRequest from .types import ListAlertRulesResponse @@ -259,6 +260,7 @@ "EnableCustomAlertRulesRequest", "EnableCustomAlertRulesResponse", "EventsOverview", + "GetCustomAlertRuleRequest", "GetLastEventsOverviewRequest", "ListAlertRulesRequest", "ListAlertRulesResponse", diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py index 70006e8de..121e0ebd5 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/api.py @@ -2,15 +2,17 @@ # If you have any remark or suggestion do not hesitate to open an issue. from datetime import datetime -from typing import Optional +from typing import Awaitable, Optional, Union from scaleway_core.api import API from scaleway_core.bridge import ( Region as ScwRegion, ) from scaleway_core.utils import ( + WaitForOptions, validate_path_param, fetch_all_pages_async, + wait_for_resource_async, ) from .types import ( AlertRuleStatus, @@ -54,6 +56,9 @@ TestCustomAlertRuleResponse, UpdateCustomAlertRuleRequest, ) +from .content import ( + CUSTOM_ALERT_RULE_TRANSIENT_STATUSES, +) from .marshalling import ( unmarshal_CustomAlertRule, unmarshal_ExportJob, @@ -725,6 +730,83 @@ async def list_custom_alert_rules_all( }, ) + async def get_custom_alert_rule( + self, + *, + custom_alert_rule_id: str, + region: Optional[ScwRegion] = None, + ) -> CustomAlertRule: + """ + Get custom alert rule metadata. + Retrieve metadata for a specified custom alert rule using the `region` and `custom_alert_rule_id` parameters. + :param custom_alert_rule_id: ID of the custom alert rule to retrieve. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`CustomAlertRule ` + + Usage: + :: + + result = await api.get_custom_alert_rule( + custom_alert_rule_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_custom_alert_rule_id = validate_path_param( + "custom_alert_rule_id", custom_alert_rule_id + ) + + res = self._request( + "GET", + f"/audit-trail/v1alpha1/regions/{param_region}/custom-alert-rules/{param_custom_alert_rule_id}", + ) + + self._throw_on_error(res) + return unmarshal_CustomAlertRule(res.json()) + + async def wait_for_custom_alert_rule( + self, + *, + custom_alert_rule_id: str, + region: Optional[ScwRegion] = None, + options: Optional[ + WaitForOptions[CustomAlertRule, Union[bool, Awaitable[bool]]] + ] = None, + ) -> CustomAlertRule: + """ + Get custom alert rule metadata. + Retrieve metadata for a specified custom alert rule using the `region` and `custom_alert_rule_id` parameters. + :param custom_alert_rule_id: ID of the custom alert rule to retrieve. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`CustomAlertRule ` + + Usage: + :: + + result = await api.get_custom_alert_rule( + custom_alert_rule_id="example", + ) + """ + + if not options: + options = WaitForOptions() + + if not options.stop: + options.stop = lambda res: ( + res.status not in CUSTOM_ALERT_RULE_TRANSIENT_STATUSES + ) + + return await wait_for_resource_async( + fetcher=self.get_custom_alert_rule, + options=options, + args={ + "custom_alert_rule_id": custom_alert_rule_id, + "region": region, + }, + ) + async def enable_alert_rules( self, *, diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py index 65b88c5aa..6b94e250c 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py @@ -359,6 +359,12 @@ def unmarshal_AlertRule(data: Any) -> AlertRule: else: args["id"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("name", None) if field is not None: args["name"] = field @@ -377,6 +383,12 @@ def unmarshal_AlertRule(data: Any) -> AlertRule: else: args["status"] = AlertRuleStatus.UNKNOWN_STATUS + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + return AlertRule(**args) diff --git a/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py b/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py index b75513d5b..ee7cca5bc 100644 --- a/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py @@ -1098,6 +1098,11 @@ class AlertRule: ID of the alert rule. """ + srn: str + """ + The SRN of the alert rule. + """ + name: str """ Name of the alert rule. @@ -1113,6 +1118,11 @@ class AlertRule: Current status of the alert rule. """ + region: ScwRegion + """ + Region of the alert rule. + """ + @dataclass class CustomAlertRule: @@ -1476,6 +1486,19 @@ class EventsOverview: last_events: list[Event] +@dataclass +class GetCustomAlertRuleRequest: + custom_alert_rule_id: str + """ + ID of the custom alert rule to retrieve. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class GetLastEventsOverviewRequest: region: Optional[ScwRegion] = None diff --git a/scaleway-async/scaleway_async/cockpit/v1/marshalling.py b/scaleway-async/scaleway_async/cockpit/v1/marshalling.py index 92dcc6525..44fe29137 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/marshalling.py +++ b/scaleway-async/scaleway_async/cockpit/v1/marshalling.py @@ -169,6 +169,18 @@ def unmarshal_DataSource(data: Any) -> DataSource: else: args["synchronized_with_grafana"] = False + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + field = data.get("retention_days", None) if field is not None: args["retention_days"] = field @@ -181,17 +193,11 @@ def unmarshal_DataSource(data: Any) -> DataSource: else: args["region"] = None - field = data.get("created_at", None) - if field is not None: - args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["created_at"] = None - - field = data.get("updated_at", None) + field = data.get("srn", None) if field is not None: - args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + args["srn"] = field else: - args["updated_at"] = None + args["srn"] = None field = data.get("current_month_usage", None) if field is not None: @@ -298,6 +304,12 @@ def unmarshal_Exporter(data: Any) -> Exporter: else: args["region"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("datadog_destination", None) if field is not None: args["datadog_destination"] = unmarshal_ExporterDatadogDestination(field) @@ -527,6 +539,12 @@ def unmarshal_AlertManager(data: Any) -> AlertManager: args: dict[str, Any] = {} + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + field = data.get("alert_manager_enabled", None) if field is not None: args["alert_manager_enabled"] = field @@ -545,6 +563,12 @@ def unmarshal_AlertManager(data: Any) -> AlertManager: else: args["region"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("alert_manager_url", None) if field is not None: args["alert_manager_url"] = field @@ -732,6 +756,18 @@ def unmarshal_Grafana(data: Any) -> Grafana: else: args["grafana_url"] = None + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + return Grafana(**args) diff --git a/scaleway-async/scaleway_async/cockpit/v1/types.py b/scaleway-async/scaleway_async/cockpit/v1/types.py index b99e40c9d..7abe366c0 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/types.py +++ b/scaleway-async/scaleway_async/cockpit/v1/types.py @@ -372,6 +372,11 @@ class DataSource: Region of the data source. """ + srn: str + """ + The SRN of the data-source. + """ + created_at: Optional[datetime] = None """ Date the data source was created. @@ -429,6 +434,11 @@ class Exporter: The region in which the export is located. """ + srn: str + """ + The SRN of the exporter. + """ + created_at: Optional[datetime] = None """ A timestamp of the creation date of the data export. @@ -658,6 +668,11 @@ class AlertManager: Alert manager information. """ + project_id: str + """ + ID of the project. + """ + alert_manager_enabled: bool """ The Alert manager is enabled. @@ -673,6 +688,11 @@ class AlertManager: Regions where the Alert manager is enabled. """ + srn: str + """ + The SRN of the alert-manager. + """ + alert_manager_url: Optional[str] = None """ Alert manager URL. @@ -965,6 +985,16 @@ class Grafana: URL to access your Cockpit's Grafana. """ + project_id: str + """ + ID of the project. + """ + + srn: str + """ + The SRN of the grafana. + """ + @dataclass class ListAlertsResponse: diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py index e30b457cd..04e59b2d2 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py @@ -1563,6 +1563,12 @@ def unmarshal_Rule(data: Any) -> Rule: else: args["id"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("permission_sets_scope_type", None) if field is not None: args["permission_sets_scope_type"] = field @@ -1575,11 +1581,11 @@ def unmarshal_Rule(data: Any) -> Rule: else: args["condition"] = None - field = data.get("srn", None) + field = data.get("deny", None) if field is not None: - args["srn"] = field + args["deny"] = field else: - args["srn"] = None + args["deny"] = False field = data.get("permission_set_names", None) if field is not None: @@ -2238,6 +2244,9 @@ def marshal_RuleSpecs( if request.condition is not None: output["condition"] = request.condition + if request.deny is not None: + output["deny"] = request.deny + if request.permission_set_names is not None: output["permission_set_names"] = request.permission_set_names diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/types.py b/scaleway-async/scaleway_async/iam/v1alpha1/types.py index 1dcfa55dc..784f17edb 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/types.py @@ -333,6 +333,11 @@ class RuleSpecs: Condition expression to evaluate. """ + deny: bool + """ + Select whether the rule should remove the permissions instead of granting them. + """ + permission_set_names: Optional[list[str]] = field(default_factory=list) """ Names of permission sets bound to the rule. @@ -849,6 +854,11 @@ class Rule: Id of rule. """ + srn: str + """ + The SRN of the rule. + """ + permission_sets_scope_type: PermissionSetScopeType """ Permission_set_names have the same scope_type. @@ -859,9 +869,9 @@ class Rule: Condition expression to evaluate. """ - srn: str + deny: bool """ - The SRN of the rule. + Select whether the rule should remove the permissions instead of granting them. """ permission_set_names: Optional[list[str]] = field(default_factory=list) diff --git a/scaleway-async/scaleway_async/instance/v1/api.py b/scaleway-async/scaleway_async/instance/v1/api.py index 2e41ee299..d049ecb1b 100644 --- a/scaleway-async/scaleway_async/instance/v1/api.py +++ b/scaleway-async/scaleway_async/instance/v1/api.py @@ -9,7 +9,9 @@ Zone as ScwZone, ) from scaleway_core.utils import ( + OneOfPossibility, random_name, + resolve_one_of, validate_path_param, fetch_all_pages_async, ) @@ -3571,6 +3573,8 @@ async def list_ips( per_page: Optional[int] = None, page: Optional[int] = None, type_: Optional[str] = None, + server: Optional[str] = None, + detached: Optional[bool] = None, ) -> ListIpsResponse: """ List all flexible IPs. @@ -3583,6 +3587,10 @@ async def list_ips( :param per_page: A positive integer lower or equal to 100 to select the number of items to return. :param page: A positive integer to choose the page to return. :param type_: Filter on the IP Mobility IP type (whose value should be either 'routed_ipv4' or 'routed_ipv6'). + :param server: + One-Of ('kind'): at most one of 'server', 'detached' could be set. + :param detached: + One-Of ('kind'): at most one of 'server', 'detached' could be set. :return: :class:`ListIpsResponse ` Usage: @@ -3604,6 +3612,12 @@ async def list_ips( "project": project or self.client.default_project_id, "tags": ",".join(tags) if tags and len(tags) > 0 else None, "type": type_, + **resolve_one_of( + [ + OneOfPossibility("detached", detached), + OneOfPossibility("server", server), + ] + ), }, ) @@ -3621,6 +3635,8 @@ async def list_ips_all( per_page: Optional[int] = None, page: Optional[int] = None, type_: Optional[str] = None, + server: Optional[str] = None, + detached: Optional[bool] = None, ) -> list[Ip]: """ List all flexible IPs. @@ -3633,6 +3649,10 @@ async def list_ips_all( :param per_page: A positive integer lower or equal to 100 to select the number of items to return. :param page: A positive integer to choose the page to return. :param type_: Filter on the IP Mobility IP type (whose value should be either 'routed_ipv4' or 'routed_ipv6'). + :param server: + One-Of ('kind'): at most one of 'server', 'detached' could be set. + :param detached: + One-Of ('kind'): at most one of 'server', 'detached' could be set. :return: :class:`list[Ip] ` Usage: @@ -3654,6 +3674,8 @@ async def list_ips_all( "per_page": per_page, "page": page, "type_": type_, + "server": server, + "detached": detached, }, ) diff --git a/scaleway-async/scaleway_async/instance/v1/types.py b/scaleway-async/scaleway_async/instance/v1/types.py index dfbabb1c1..7237c85f6 100644 --- a/scaleway-async/scaleway_async/instance/v1/types.py +++ b/scaleway-async/scaleway_async/instance/v1/types.py @@ -2486,6 +2486,10 @@ class ListIpsRequest: Filter on the IP Mobility IP type (whose value should be either 'routed_ipv4' or 'routed_ipv6'). """ + server: Optional[str] = None + + detached: Optional[bool] = None + @dataclass class ListIpsResponse: diff --git a/scaleway-async/scaleway_async/instance/v2alpha1/api.py b/scaleway-async/scaleway_async/instance/v2alpha1/api.py index 03fde4560..bee5e29f2 100644 --- a/scaleway-async/scaleway_async/instance/v2alpha1/api.py +++ b/scaleway-async/scaleway_async/instance/v2alpha1/api.py @@ -1272,6 +1272,7 @@ async def list_private_network_interfaces( order_by: Optional[ListPrivateNetworkInterfacesRequestOrderBy] = None, project_id: Optional[str] = None, server_ids: Optional[list[str]] = None, + security_group_ids: Optional[list[str]] = None, private_network_ids: Optional[list[str]] = None, tags: Optional[list[str]] = None, ) -> ListPrivateNetworkInterfacesResponse: @@ -1284,6 +1285,7 @@ async def list_private_network_interfaces( :param order_by: Field to order results by. :param project_id: Filter by Project ID. :param server_ids: Filter by server IDs. + :param security_group_ids: Filter by security group IDs. :param private_network_ids: Filter by Private Network IDs. :param tags: Filter by tags. :return: :class:`ListPrivateNetworkInterfacesResponse ` @@ -1305,6 +1307,7 @@ async def list_private_network_interfaces( "page_token": page_token, "private_network_ids": private_network_ids, "project_id": project_id or self.client.default_project_id, + "security_group_ids": security_group_ids, "server_ids": server_ids, "tags": tags, }, @@ -1320,6 +1323,7 @@ async def create_private_network_interface( zone: Optional[ScwZone] = None, project_id: Optional[str] = None, server_id: Optional[str] = None, + security_group_id: Optional[str] = None, ip_ids: Optional[list[str]] = None, tags: Optional[list[str]] = None, ) -> PrivateNetworkInterface: @@ -1330,6 +1334,7 @@ async def create_private_network_interface( :param zone: Zone to target. If none is passed will use default zone from the config. :param project_id: Project ID for the private network interface. :param server_id: ID of the Instance to attach the interface to. + :param security_group_id: ID of the security group to associate with the interface. :param ip_ids: List of IP IDs to attach to the interface. :param tags: Tags to assign to the private network interface. :return: :class:`PrivateNetworkInterface ` @@ -1353,6 +1358,7 @@ async def create_private_network_interface( zone=zone, project_id=project_id, server_id=server_id, + security_group_id=security_group_id, ip_ids=ip_ids, tags=tags, ), @@ -1443,6 +1449,7 @@ async def update_private_network_interface( *, private_network_interface_id: str, zone: Optional[ScwZone] = None, + security_group_id: Optional[str] = None, tags: Optional[list[str]] = None, ) -> PrivateNetworkInterface: """ @@ -1450,6 +1457,7 @@ async def update_private_network_interface( Update the properties of a specified private network interface. :param private_network_interface_id: ID of the private network interface to update. :param zone: Zone to target. If none is passed will use default zone from the config. + :param security_group_id: New security group ID to associate with the interface. :param tags: New tags to assign to the private network interface. :return: :class:`PrivateNetworkInterface ` @@ -1473,6 +1481,7 @@ async def update_private_network_interface( UpdatePrivateNetworkInterfaceRequest( private_network_interface_id=private_network_interface_id, zone=zone, + security_group_id=security_group_id, tags=tags, ), self.client, diff --git a/scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py b/scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py index a448a1a53..ea9720c6b 100644 --- a/scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/instance/v2alpha1/marshalling.py @@ -1027,6 +1027,12 @@ def unmarshal_PrivateNetworkInterfaceSummary( else: args["server_id"] = None + field = data.get("security_group_id", None) + if field is not None: + args["security_group_id"] = field + else: + args["security_group_id"] = None + field = data.get("mac_address", None) if field is not None: args["mac_address"] = field @@ -1865,6 +1871,12 @@ def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface: else: args["server_id"] = None + field = data.get("security_group_id", None) + if field is not None: + args["security_group_id"] = field + else: + args["security_group_id"] = None + field = data.get("mac_address", None) if field is not None: args["mac_address"] = field @@ -2397,6 +2409,12 @@ def unmarshal_CreateTemplateRequestPrivateNetworkTemplate( else: args["private_network_id"] = None + field = data.get("security_group_id", None) + if field is not None: + args["security_group_id"] = field + else: + args["security_group_id"] = None + return CreateTemplateRequestPrivateNetworkTemplate(**args) @@ -2777,6 +2795,9 @@ def marshal_CreatePrivateNetworkInterfaceRequest( if request.server_id is not None: output["server_id"] = request.server_id + if request.security_group_id is not None: + output["security_group_id"] = request.security_group_id + if request.ip_ids is not None: output["ip_ids"] = request.ip_ids @@ -3006,6 +3027,9 @@ def marshal_CreateTemplateRequestPrivateNetworkTemplate( if request.private_network_id is not None: output["private_network_id"] = request.private_network_id + if request.security_group_id is not None: + output["security_group_id"] = request.security_group_id + return output @@ -3337,6 +3361,9 @@ def marshal_UpdatePrivateNetworkInterfaceRequest( ) -> dict[str, Any]: output: dict[str, Any] = {} + if request.security_group_id is not None: + output["security_group_id"] = request.security_group_id + if request.tags is not None: output["tags"] = request.tags diff --git a/scaleway-async/scaleway_async/instance/v2alpha1/types.py b/scaleway-async/scaleway_async/instance/v2alpha1/types.py index 8d87f4834..129a8a1ca 100644 --- a/scaleway-async/scaleway_async/instance/v2alpha1/types.py +++ b/scaleway-async/scaleway_async/instance/v2alpha1/types.py @@ -526,6 +526,11 @@ class CreateTemplateRequestPrivateNetworkTemplate: ID of the private network. """ + security_group_id: Optional[str] = None + """ + ID of the security group for the private network. + """ + @dataclass class CreateTemplateRequestVolumeTemplate: @@ -886,6 +891,11 @@ class PrivateNetworkInterfaceSummary: ID of the Instance this interface is attached to. """ + security_group_id: str + """ + ID of the security group associated with this interface. + """ + mac_address: str """ MAC address of the private network interface. @@ -1614,6 +1624,11 @@ class CreatePrivateNetworkInterfaceRequest: ID of the Instance to attach the interface to. """ + security_group_id: Optional[str] = None + """ + ID of the security group to associate with the interface. + """ + ip_ids: Optional[list[str]] = field(default_factory=list) """ List of IP IDs to attach to the interface. @@ -2424,6 +2439,11 @@ class ListPrivateNetworkInterfacesRequest: Filter by server IDs. """ + security_group_ids: Optional[list[str]] = field(default_factory=list) + """ + Filter by security group IDs. + """ + private_network_ids: Optional[list[str]] = field(default_factory=list) """ Filter by Private Network IDs. @@ -2918,6 +2938,11 @@ class PrivateNetworkInterface: ID of the Instance this interface is attached to. """ + security_group_id: str + """ + ID of the security group associated with this interface. + """ + mac_address: str """ MAC address of the private network interface. @@ -3500,6 +3525,11 @@ class UpdatePrivateNetworkInterfaceRequest: Zone to target. If none is passed will use default zone from the config. """ + security_group_id: Optional[str] = None + """ + New security group ID to associate with the interface. + """ + tags: Optional[list[str]] = field(default_factory=list) """ New tags to assign to the private network interface. diff --git a/scaleway-async/scaleway_async/kafka/v1alpha1/api.py b/scaleway-async/scaleway_async/kafka/v1alpha1/api.py index fadc00014..b2513f349 100644 --- a/scaleway-async/scaleway_async/kafka/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/kafka/v1alpha1/api.py @@ -464,6 +464,7 @@ async def update_cluster( name: Optional[str] = None, tags: Optional[list[str]] = None, version: Optional[str] = None, + volume_size_bytes: Optional[int] = None, ) -> Cluster: """ Update a Kafka cluster. @@ -473,6 +474,7 @@ async def update_cluster( :param name: Name of the Kafka Cluster. :param tags: Tags of a Kafka Cluster. :param version: Version of Kafka. + :param volume_size_bytes: New volume size for each broker, can only increase. :return: :class:`Cluster ` Usage: @@ -498,6 +500,7 @@ async def update_cluster( name=name, tags=tags, version=version, + volume_size_bytes=volume_size_bytes, ), self.client, ), diff --git a/scaleway-async/scaleway_async/kafka/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/kafka/v1alpha1/marshalling.py index 3843ac37c..1fd64de38 100644 --- a/scaleway-async/scaleway_async/kafka/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/kafka/v1alpha1/marshalling.py @@ -929,6 +929,9 @@ def marshal_UpdateClusterRequest( if request.version is not None: output["version"] = request.version + if request.volume_size_bytes is not None: + output["volume_size_bytes"] = request.volume_size_bytes + return output diff --git a/scaleway-async/scaleway_async/kafka/v1alpha1/types.py b/scaleway-async/scaleway_async/kafka/v1alpha1/types.py index 5bdbd0296..529f3890f 100644 --- a/scaleway-async/scaleway_async/kafka/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/kafka/v1alpha1/types.py @@ -738,6 +738,11 @@ class UpdateClusterRequest: Version of Kafka. """ + volume_size_bytes: Optional[int] = 0 + """ + New volume size for each broker, can only increase. + """ + @dataclass class UpdateUserRequest: diff --git a/scaleway-async/scaleway_async/lb/v1/marshalling.py b/scaleway-async/scaleway_async/lb/v1/marshalling.py index 6adbe36e8..61a558806 100644 --- a/scaleway-async/scaleway_async/lb/v1/marshalling.py +++ b/scaleway-async/scaleway_async/lb/v1/marshalling.py @@ -173,6 +173,12 @@ def unmarshal_Ip(data: Any) -> Ip: else: args["zone"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("lb_id", None) if field is not None: args["lb_id"] = field @@ -242,6 +248,18 @@ def unmarshal_Subscriber(data: Any) -> Subscriber: else: args["name"] = None + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("email_config", None) if field is not None: args["email_config"] = unmarshal_SubscriberEmailConfig(field) @@ -650,6 +668,12 @@ def unmarshal_Lb(data: Any) -> Lb: else: args["zone"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("subscriber", None) if field is not None: args["subscriber"] = unmarshal_Subscriber(field) @@ -733,18 +757,6 @@ def unmarshal_Backend(data: Any) -> Backend: else: args["pool"] = [] - field = data.get("on_marked_down_action", None) - if field is not None: - args["on_marked_down_action"] = field - else: - args["on_marked_down_action"] = OnMarkedDownAction.ON_MARKED_DOWN_ACTION_NONE - - field = data.get("proxy_protocol", None) - if field is not None: - args["proxy_protocol"] = field - else: - args["proxy_protocol"] = ProxyProtocol.PROXY_PROTOCOL_UNKNOWN - field = data.get("health_check", None) if field is not None: args["health_check"] = unmarshal_HealthCheck(field) @@ -781,6 +793,18 @@ def unmarshal_Backend(data: Any) -> Backend: else: args["timeout_tunnel"] = None + field = data.get("on_marked_down_action", None) + if field is not None: + args["on_marked_down_action"] = field + else: + args["on_marked_down_action"] = OnMarkedDownAction.ON_MARKED_DOWN_ACTION_NONE + + field = data.get("proxy_protocol", None) + if field is not None: + args["proxy_protocol"] = field + else: + args["proxy_protocol"] = ProxyProtocol.PROXY_PROTOCOL_UNKNOWN + field = data.get("created_at", None) if field is not None: args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field @@ -811,6 +835,18 @@ def unmarshal_Backend(data: Any) -> Backend: else: args["ignore_ssl_server_verify"] = False + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("redispatch_attempt_count", None) if field is not None: args["redispatch_attempt_count"] = field @@ -916,6 +952,18 @@ def unmarshal_Certificate(data: Any) -> Certificate: else: args["name"] = None + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("created_at", None) if field is not None: args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field @@ -969,6 +1017,12 @@ def unmarshal_Frontend(data: Any) -> Frontend: else: args["certificate_ids"] = [] + field = data.get("enable_http3", None) + if field is not None: + args["enable_http3"] = field + else: + args["enable_http3"] = False + field = data.get("backend", None) if field is not None: args["backend"] = unmarshal_Backend(field) @@ -987,18 +1041,24 @@ def unmarshal_Frontend(data: Any) -> Frontend: else: args["timeout_client"] = None - field = data.get("enable_http3", None) - if field is not None: - args["enable_http3"] = field - else: - args["enable_http3"] = False - field = data.get("enable_access_logs", None) if field is not None: args["enable_access_logs"] = field else: args["enable_access_logs"] = False + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("certificate", None) if field is not None: args["certificate"] = unmarshal_Certificate(field) @@ -1157,6 +1217,18 @@ def unmarshal_Acl(data: Any) -> Acl: else: args["description"] = None + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("match", None) if field is not None: args["match"] = unmarshal_AclMatch(field) @@ -1361,6 +1433,18 @@ def unmarshal_Route(data: Any) -> Route: else: args["backend_id"] = None + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("match", None) if field is not None: args["match"] = unmarshal_RouteMatch(field) @@ -1669,6 +1753,12 @@ def unmarshal_LbType(data: Any) -> LbType: else: args["zone"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("region", None) if field is not None: args["region"] = field diff --git a/scaleway-async/scaleway_async/lb/v1/types.py b/scaleway-async/scaleway_async/lb/v1/types.py index 08a0ed3fc..a695b239e 100644 --- a/scaleway-async/scaleway_async/lb/v1/types.py +++ b/scaleway-async/scaleway_async/lb/v1/types.py @@ -451,6 +451,11 @@ class Ip: The zone the IP address is in. """ + srn: str + """ + The SRN of the IP address. + """ + lb_id: Optional[str] = None """ Load Balancer ID. @@ -478,6 +483,16 @@ class Subscriber: Subscriber name. """ + zone: ScwZone + """ + The zone the subscriber is in. + """ + + srn: str + """ + The SRN of the subscriber. + """ + email_config: Optional[SubscriberEmailConfig] = None webhook_config: Optional[SubscriberWebhookConfig] = None @@ -612,6 +627,11 @@ class Lb: The zone the Load Balancer is in. """ + srn: str + """ + The SRN of the Load Balancer. + """ + subscriber: Optional[Subscriber] = None """ Subscriber information. @@ -703,6 +723,16 @@ class Backend: Protocol to use between the Load Balancer and backend servers. Allows the backend servers to be informed of the client's real IP address. The PROXY protocol must be supported by the backend servers' software. """ + zone: ScwZone + """ + The zone the backend is in. + """ + + srn: str + """ + The SRN of the backend. + """ + health_check: Optional[HealthCheck] = None """ Object defining the health check to be carried out by the backend when checking the status and health of backend servers. @@ -821,6 +851,16 @@ class Certificate: Certificate name. """ + zone: ScwZone + """ + The zone the certificate is in. + """ + + srn: str + """ + The SRN of the certificate. + """ + not_valid_before: Optional[datetime] = None """ Lower validity bound. @@ -930,6 +970,16 @@ class Frontend: Defines whether to enable access logs on the frontend. """ + zone: ScwZone + """ + The zone the frontend is in. + """ + + srn: str + """ + The SRN of the frontend. + """ + backend: Optional[Backend] = None """ Backend object the frontend is attached to. @@ -1074,6 +1124,16 @@ class Acl: ACL description. """ + zone: ScwZone + """ + The zone the ACL is in. + """ + + srn: str + """ + The SRN of the ACL. + """ + match: Optional[AclMatch] = None """ ACL match filter object. One of `ip_subnet`, `ips_edge_services` or `http_filter` & `http_filter_value` are required. @@ -1171,6 +1231,11 @@ class LbType: The zone the Load Balancer stock is in. """ + srn: str + """ + The SRN of the Load Balancer offer type. + """ + region: Optional[ScwRegion] = None """ The region the Load Balancer stock is in. @@ -1194,6 +1259,16 @@ class Route: ID of the target backend. """ + zone: ScwZone + """ + The zone the route is in. + """ + + srn: str + """ + The SRN of the route. + """ + match: Optional[RouteMatch] = None """ Object defining the match condition for a route to be applied. If an incoming client session matches the specified condition (i.e. it has a matching SNI value or HTTP Host header value), it will be passed to the target backend. diff --git a/scaleway-async/scaleway_async/partner/v1/marshalling.py b/scaleway-async/scaleway_async/partner/v1/marshalling.py index 89638845c..3c029b07d 100644 --- a/scaleway-async/scaleway_async/partner/v1/marshalling.py +++ b/scaleway-async/scaleway_async/partner/v1/marshalling.py @@ -96,6 +96,12 @@ def unmarshal_Organization(data: Any) -> Organization: else: args["comment"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("locked_at", None) if field is not None: args["locked_at"] = parser.isoparse(field) if isinstance(field, str) else field diff --git a/scaleway-async/scaleway_async/partner/v1/types.py b/scaleway-async/scaleway_async/partner/v1/types.py index f929e2dce..85414908a 100644 --- a/scaleway-async/scaleway_async/partner/v1/types.py +++ b/scaleway-async/scaleway_async/partner/v1/types.py @@ -91,6 +91,11 @@ class Organization: A comment about the organization. """ + srn: str + """ + The SRN of the organization. + """ + created_at: Optional[datetime] = None """ Date of organization creation. diff --git a/scaleway/scaleway/audit_trail/v1alpha1/__init__.py b/scaleway/scaleway/audit_trail/v1alpha1/__init__.py index 7714e6e3d..3f2fb4441 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/__init__.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/__init__.py @@ -115,6 +115,7 @@ from .types import EnableCustomAlertRulesRequest from .types import EnableCustomAlertRulesResponse from .types import EventsOverview +from .types import GetCustomAlertRuleRequest from .types import GetLastEventsOverviewRequest from .types import ListAlertRulesRequest from .types import ListAlertRulesResponse @@ -259,6 +260,7 @@ "EnableCustomAlertRulesRequest", "EnableCustomAlertRulesResponse", "EventsOverview", + "GetCustomAlertRuleRequest", "GetLastEventsOverviewRequest", "ListAlertRulesRequest", "ListAlertRulesResponse", diff --git a/scaleway/scaleway/audit_trail/v1alpha1/api.py b/scaleway/scaleway/audit_trail/v1alpha1/api.py index 7c18a40a2..f23ab2226 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/api.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/api.py @@ -9,8 +9,10 @@ Region as ScwRegion, ) from scaleway_core.utils import ( + WaitForOptions, validate_path_param, fetch_all_pages, + wait_for_resource, ) from .types import ( AlertRuleStatus, @@ -54,6 +56,9 @@ TestCustomAlertRuleResponse, UpdateCustomAlertRuleRequest, ) +from .content import ( + CUSTOM_ALERT_RULE_TRANSIENT_STATUSES, +) from .marshalling import ( unmarshal_CustomAlertRule, unmarshal_ExportJob, @@ -725,6 +730,81 @@ def list_custom_alert_rules_all( }, ) + def get_custom_alert_rule( + self, + *, + custom_alert_rule_id: str, + region: Optional[ScwRegion] = None, + ) -> CustomAlertRule: + """ + Get custom alert rule metadata. + Retrieve metadata for a specified custom alert rule using the `region` and `custom_alert_rule_id` parameters. + :param custom_alert_rule_id: ID of the custom alert rule to retrieve. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`CustomAlertRule ` + + Usage: + :: + + result = api.get_custom_alert_rule( + custom_alert_rule_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_custom_alert_rule_id = validate_path_param( + "custom_alert_rule_id", custom_alert_rule_id + ) + + res = self._request( + "GET", + f"/audit-trail/v1alpha1/regions/{param_region}/custom-alert-rules/{param_custom_alert_rule_id}", + ) + + self._throw_on_error(res) + return unmarshal_CustomAlertRule(res.json()) + + def wait_for_custom_alert_rule( + self, + *, + custom_alert_rule_id: str, + region: Optional[ScwRegion] = None, + options: Optional[WaitForOptions[CustomAlertRule, bool]] = None, + ) -> CustomAlertRule: + """ + Get custom alert rule metadata. + Retrieve metadata for a specified custom alert rule using the `region` and `custom_alert_rule_id` parameters. + :param custom_alert_rule_id: ID of the custom alert rule to retrieve. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`CustomAlertRule ` + + Usage: + :: + + result = api.get_custom_alert_rule( + custom_alert_rule_id="example", + ) + """ + + if not options: + options = WaitForOptions() + + if not options.stop: + options.stop = lambda res: ( + res.status not in CUSTOM_ALERT_RULE_TRANSIENT_STATUSES + ) + + return wait_for_resource( + fetcher=self.get_custom_alert_rule, + options=options, + args={ + "custom_alert_rule_id": custom_alert_rule_id, + "region": region, + }, + ) + def enable_alert_rules( self, *, diff --git a/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py b/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py index 65b88c5aa..6b94e250c 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/marshalling.py @@ -359,6 +359,12 @@ def unmarshal_AlertRule(data: Any) -> AlertRule: else: args["id"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("name", None) if field is not None: args["name"] = field @@ -377,6 +383,12 @@ def unmarshal_AlertRule(data: Any) -> AlertRule: else: args["status"] = AlertRuleStatus.UNKNOWN_STATUS + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + return AlertRule(**args) diff --git a/scaleway/scaleway/audit_trail/v1alpha1/types.py b/scaleway/scaleway/audit_trail/v1alpha1/types.py index b75513d5b..ee7cca5bc 100644 --- a/scaleway/scaleway/audit_trail/v1alpha1/types.py +++ b/scaleway/scaleway/audit_trail/v1alpha1/types.py @@ -1098,6 +1098,11 @@ class AlertRule: ID of the alert rule. """ + srn: str + """ + The SRN of the alert rule. + """ + name: str """ Name of the alert rule. @@ -1113,6 +1118,11 @@ class AlertRule: Current status of the alert rule. """ + region: ScwRegion + """ + Region of the alert rule. + """ + @dataclass class CustomAlertRule: @@ -1476,6 +1486,19 @@ class EventsOverview: last_events: list[Event] +@dataclass +class GetCustomAlertRuleRequest: + custom_alert_rule_id: str + """ + ID of the custom alert rule to retrieve. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class GetLastEventsOverviewRequest: region: Optional[ScwRegion] = None diff --git a/scaleway/scaleway/cockpit/v1/marshalling.py b/scaleway/scaleway/cockpit/v1/marshalling.py index 92dcc6525..44fe29137 100644 --- a/scaleway/scaleway/cockpit/v1/marshalling.py +++ b/scaleway/scaleway/cockpit/v1/marshalling.py @@ -169,6 +169,18 @@ def unmarshal_DataSource(data: Any) -> DataSource: else: args["synchronized_with_grafana"] = False + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + field = data.get("retention_days", None) if field is not None: args["retention_days"] = field @@ -181,17 +193,11 @@ def unmarshal_DataSource(data: Any) -> DataSource: else: args["region"] = None - field = data.get("created_at", None) - if field is not None: - args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["created_at"] = None - - field = data.get("updated_at", None) + field = data.get("srn", None) if field is not None: - args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + args["srn"] = field else: - args["updated_at"] = None + args["srn"] = None field = data.get("current_month_usage", None) if field is not None: @@ -298,6 +304,12 @@ def unmarshal_Exporter(data: Any) -> Exporter: else: args["region"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("datadog_destination", None) if field is not None: args["datadog_destination"] = unmarshal_ExporterDatadogDestination(field) @@ -527,6 +539,12 @@ def unmarshal_AlertManager(data: Any) -> AlertManager: args: dict[str, Any] = {} + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + field = data.get("alert_manager_enabled", None) if field is not None: args["alert_manager_enabled"] = field @@ -545,6 +563,12 @@ def unmarshal_AlertManager(data: Any) -> AlertManager: else: args["region"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("alert_manager_url", None) if field is not None: args["alert_manager_url"] = field @@ -732,6 +756,18 @@ def unmarshal_Grafana(data: Any) -> Grafana: else: args["grafana_url"] = None + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + else: + args["project_id"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + return Grafana(**args) diff --git a/scaleway/scaleway/cockpit/v1/types.py b/scaleway/scaleway/cockpit/v1/types.py index b99e40c9d..7abe366c0 100644 --- a/scaleway/scaleway/cockpit/v1/types.py +++ b/scaleway/scaleway/cockpit/v1/types.py @@ -372,6 +372,11 @@ class DataSource: Region of the data source. """ + srn: str + """ + The SRN of the data-source. + """ + created_at: Optional[datetime] = None """ Date the data source was created. @@ -429,6 +434,11 @@ class Exporter: The region in which the export is located. """ + srn: str + """ + The SRN of the exporter. + """ + created_at: Optional[datetime] = None """ A timestamp of the creation date of the data export. @@ -658,6 +668,11 @@ class AlertManager: Alert manager information. """ + project_id: str + """ + ID of the project. + """ + alert_manager_enabled: bool """ The Alert manager is enabled. @@ -673,6 +688,11 @@ class AlertManager: Regions where the Alert manager is enabled. """ + srn: str + """ + The SRN of the alert-manager. + """ + alert_manager_url: Optional[str] = None """ Alert manager URL. @@ -965,6 +985,16 @@ class Grafana: URL to access your Cockpit's Grafana. """ + project_id: str + """ + ID of the project. + """ + + srn: str + """ + The SRN of the grafana. + """ + @dataclass class ListAlertsResponse: diff --git a/scaleway/scaleway/iam/v1alpha1/marshalling.py b/scaleway/scaleway/iam/v1alpha1/marshalling.py index e30b457cd..04e59b2d2 100644 --- a/scaleway/scaleway/iam/v1alpha1/marshalling.py +++ b/scaleway/scaleway/iam/v1alpha1/marshalling.py @@ -1563,6 +1563,12 @@ def unmarshal_Rule(data: Any) -> Rule: else: args["id"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("permission_sets_scope_type", None) if field is not None: args["permission_sets_scope_type"] = field @@ -1575,11 +1581,11 @@ def unmarshal_Rule(data: Any) -> Rule: else: args["condition"] = None - field = data.get("srn", None) + field = data.get("deny", None) if field is not None: - args["srn"] = field + args["deny"] = field else: - args["srn"] = None + args["deny"] = False field = data.get("permission_set_names", None) if field is not None: @@ -2238,6 +2244,9 @@ def marshal_RuleSpecs( if request.condition is not None: output["condition"] = request.condition + if request.deny is not None: + output["deny"] = request.deny + if request.permission_set_names is not None: output["permission_set_names"] = request.permission_set_names diff --git a/scaleway/scaleway/iam/v1alpha1/types.py b/scaleway/scaleway/iam/v1alpha1/types.py index 1dcfa55dc..784f17edb 100644 --- a/scaleway/scaleway/iam/v1alpha1/types.py +++ b/scaleway/scaleway/iam/v1alpha1/types.py @@ -333,6 +333,11 @@ class RuleSpecs: Condition expression to evaluate. """ + deny: bool + """ + Select whether the rule should remove the permissions instead of granting them. + """ + permission_set_names: Optional[list[str]] = field(default_factory=list) """ Names of permission sets bound to the rule. @@ -849,6 +854,11 @@ class Rule: Id of rule. """ + srn: str + """ + The SRN of the rule. + """ + permission_sets_scope_type: PermissionSetScopeType """ Permission_set_names have the same scope_type. @@ -859,9 +869,9 @@ class Rule: Condition expression to evaluate. """ - srn: str + deny: bool """ - The SRN of the rule. + Select whether the rule should remove the permissions instead of granting them. """ permission_set_names: Optional[list[str]] = field(default_factory=list) diff --git a/scaleway/scaleway/instance/v1/api.py b/scaleway/scaleway/instance/v1/api.py index 07812e67d..edc05b355 100644 --- a/scaleway/scaleway/instance/v1/api.py +++ b/scaleway/scaleway/instance/v1/api.py @@ -9,7 +9,9 @@ Zone as ScwZone, ) from scaleway_core.utils import ( + OneOfPossibility, random_name, + resolve_one_of, validate_path_param, fetch_all_pages, ) @@ -3571,6 +3573,8 @@ def list_ips( per_page: Optional[int] = None, page: Optional[int] = None, type_: Optional[str] = None, + server: Optional[str] = None, + detached: Optional[bool] = None, ) -> ListIpsResponse: """ List all flexible IPs. @@ -3583,6 +3587,10 @@ def list_ips( :param per_page: A positive integer lower or equal to 100 to select the number of items to return. :param page: A positive integer to choose the page to return. :param type_: Filter on the IP Mobility IP type (whose value should be either 'routed_ipv4' or 'routed_ipv6'). + :param server: + One-Of ('kind'): at most one of 'server', 'detached' could be set. + :param detached: + One-Of ('kind'): at most one of 'server', 'detached' could be set. :return: :class:`ListIpsResponse ` Usage: @@ -3604,6 +3612,12 @@ def list_ips( "project": project or self.client.default_project_id, "tags": ",".join(tags) if tags and len(tags) > 0 else None, "type": type_, + **resolve_one_of( + [ + OneOfPossibility("detached", detached), + OneOfPossibility("server", server), + ] + ), }, ) @@ -3621,6 +3635,8 @@ def list_ips_all( per_page: Optional[int] = None, page: Optional[int] = None, type_: Optional[str] = None, + server: Optional[str] = None, + detached: Optional[bool] = None, ) -> list[Ip]: """ List all flexible IPs. @@ -3633,6 +3649,10 @@ def list_ips_all( :param per_page: A positive integer lower or equal to 100 to select the number of items to return. :param page: A positive integer to choose the page to return. :param type_: Filter on the IP Mobility IP type (whose value should be either 'routed_ipv4' or 'routed_ipv6'). + :param server: + One-Of ('kind'): at most one of 'server', 'detached' could be set. + :param detached: + One-Of ('kind'): at most one of 'server', 'detached' could be set. :return: :class:`list[Ip] ` Usage: @@ -3654,6 +3674,8 @@ def list_ips_all( "per_page": per_page, "page": page, "type_": type_, + "server": server, + "detached": detached, }, ) diff --git a/scaleway/scaleway/instance/v1/types.py b/scaleway/scaleway/instance/v1/types.py index dfbabb1c1..7237c85f6 100644 --- a/scaleway/scaleway/instance/v1/types.py +++ b/scaleway/scaleway/instance/v1/types.py @@ -2486,6 +2486,10 @@ class ListIpsRequest: Filter on the IP Mobility IP type (whose value should be either 'routed_ipv4' or 'routed_ipv6'). """ + server: Optional[str] = None + + detached: Optional[bool] = None + @dataclass class ListIpsResponse: diff --git a/scaleway/scaleway/instance/v2alpha1/api.py b/scaleway/scaleway/instance/v2alpha1/api.py index 0ab39d285..315e2500e 100644 --- a/scaleway/scaleway/instance/v2alpha1/api.py +++ b/scaleway/scaleway/instance/v2alpha1/api.py @@ -1272,6 +1272,7 @@ def list_private_network_interfaces( order_by: Optional[ListPrivateNetworkInterfacesRequestOrderBy] = None, project_id: Optional[str] = None, server_ids: Optional[list[str]] = None, + security_group_ids: Optional[list[str]] = None, private_network_ids: Optional[list[str]] = None, tags: Optional[list[str]] = None, ) -> ListPrivateNetworkInterfacesResponse: @@ -1284,6 +1285,7 @@ def list_private_network_interfaces( :param order_by: Field to order results by. :param project_id: Filter by Project ID. :param server_ids: Filter by server IDs. + :param security_group_ids: Filter by security group IDs. :param private_network_ids: Filter by Private Network IDs. :param tags: Filter by tags. :return: :class:`ListPrivateNetworkInterfacesResponse ` @@ -1305,6 +1307,7 @@ def list_private_network_interfaces( "page_token": page_token, "private_network_ids": private_network_ids, "project_id": project_id or self.client.default_project_id, + "security_group_ids": security_group_ids, "server_ids": server_ids, "tags": tags, }, @@ -1320,6 +1323,7 @@ def create_private_network_interface( zone: Optional[ScwZone] = None, project_id: Optional[str] = None, server_id: Optional[str] = None, + security_group_id: Optional[str] = None, ip_ids: Optional[list[str]] = None, tags: Optional[list[str]] = None, ) -> PrivateNetworkInterface: @@ -1330,6 +1334,7 @@ def create_private_network_interface( :param zone: Zone to target. If none is passed will use default zone from the config. :param project_id: Project ID for the private network interface. :param server_id: ID of the Instance to attach the interface to. + :param security_group_id: ID of the security group to associate with the interface. :param ip_ids: List of IP IDs to attach to the interface. :param tags: Tags to assign to the private network interface. :return: :class:`PrivateNetworkInterface ` @@ -1353,6 +1358,7 @@ def create_private_network_interface( zone=zone, project_id=project_id, server_id=server_id, + security_group_id=security_group_id, ip_ids=ip_ids, tags=tags, ), @@ -1441,6 +1447,7 @@ def update_private_network_interface( *, private_network_interface_id: str, zone: Optional[ScwZone] = None, + security_group_id: Optional[str] = None, tags: Optional[list[str]] = None, ) -> PrivateNetworkInterface: """ @@ -1448,6 +1455,7 @@ def update_private_network_interface( Update the properties of a specified private network interface. :param private_network_interface_id: ID of the private network interface to update. :param zone: Zone to target. If none is passed will use default zone from the config. + :param security_group_id: New security group ID to associate with the interface. :param tags: New tags to assign to the private network interface. :return: :class:`PrivateNetworkInterface ` @@ -1471,6 +1479,7 @@ def update_private_network_interface( UpdatePrivateNetworkInterfaceRequest( private_network_interface_id=private_network_interface_id, zone=zone, + security_group_id=security_group_id, tags=tags, ), self.client, diff --git a/scaleway/scaleway/instance/v2alpha1/marshalling.py b/scaleway/scaleway/instance/v2alpha1/marshalling.py index a448a1a53..ea9720c6b 100644 --- a/scaleway/scaleway/instance/v2alpha1/marshalling.py +++ b/scaleway/scaleway/instance/v2alpha1/marshalling.py @@ -1027,6 +1027,12 @@ def unmarshal_PrivateNetworkInterfaceSummary( else: args["server_id"] = None + field = data.get("security_group_id", None) + if field is not None: + args["security_group_id"] = field + else: + args["security_group_id"] = None + field = data.get("mac_address", None) if field is not None: args["mac_address"] = field @@ -1865,6 +1871,12 @@ def unmarshal_PrivateNetworkInterface(data: Any) -> PrivateNetworkInterface: else: args["server_id"] = None + field = data.get("security_group_id", None) + if field is not None: + args["security_group_id"] = field + else: + args["security_group_id"] = None + field = data.get("mac_address", None) if field is not None: args["mac_address"] = field @@ -2397,6 +2409,12 @@ def unmarshal_CreateTemplateRequestPrivateNetworkTemplate( else: args["private_network_id"] = None + field = data.get("security_group_id", None) + if field is not None: + args["security_group_id"] = field + else: + args["security_group_id"] = None + return CreateTemplateRequestPrivateNetworkTemplate(**args) @@ -2777,6 +2795,9 @@ def marshal_CreatePrivateNetworkInterfaceRequest( if request.server_id is not None: output["server_id"] = request.server_id + if request.security_group_id is not None: + output["security_group_id"] = request.security_group_id + if request.ip_ids is not None: output["ip_ids"] = request.ip_ids @@ -3006,6 +3027,9 @@ def marshal_CreateTemplateRequestPrivateNetworkTemplate( if request.private_network_id is not None: output["private_network_id"] = request.private_network_id + if request.security_group_id is not None: + output["security_group_id"] = request.security_group_id + return output @@ -3337,6 +3361,9 @@ def marshal_UpdatePrivateNetworkInterfaceRequest( ) -> dict[str, Any]: output: dict[str, Any] = {} + if request.security_group_id is not None: + output["security_group_id"] = request.security_group_id + if request.tags is not None: output["tags"] = request.tags diff --git a/scaleway/scaleway/instance/v2alpha1/types.py b/scaleway/scaleway/instance/v2alpha1/types.py index 8d87f4834..129a8a1ca 100644 --- a/scaleway/scaleway/instance/v2alpha1/types.py +++ b/scaleway/scaleway/instance/v2alpha1/types.py @@ -526,6 +526,11 @@ class CreateTemplateRequestPrivateNetworkTemplate: ID of the private network. """ + security_group_id: Optional[str] = None + """ + ID of the security group for the private network. + """ + @dataclass class CreateTemplateRequestVolumeTemplate: @@ -886,6 +891,11 @@ class PrivateNetworkInterfaceSummary: ID of the Instance this interface is attached to. """ + security_group_id: str + """ + ID of the security group associated with this interface. + """ + mac_address: str """ MAC address of the private network interface. @@ -1614,6 +1624,11 @@ class CreatePrivateNetworkInterfaceRequest: ID of the Instance to attach the interface to. """ + security_group_id: Optional[str] = None + """ + ID of the security group to associate with the interface. + """ + ip_ids: Optional[list[str]] = field(default_factory=list) """ List of IP IDs to attach to the interface. @@ -2424,6 +2439,11 @@ class ListPrivateNetworkInterfacesRequest: Filter by server IDs. """ + security_group_ids: Optional[list[str]] = field(default_factory=list) + """ + Filter by security group IDs. + """ + private_network_ids: Optional[list[str]] = field(default_factory=list) """ Filter by Private Network IDs. @@ -2918,6 +2938,11 @@ class PrivateNetworkInterface: ID of the Instance this interface is attached to. """ + security_group_id: str + """ + ID of the security group associated with this interface. + """ + mac_address: str """ MAC address of the private network interface. @@ -3500,6 +3525,11 @@ class UpdatePrivateNetworkInterfaceRequest: Zone to target. If none is passed will use default zone from the config. """ + security_group_id: Optional[str] = None + """ + New security group ID to associate with the interface. + """ + tags: Optional[list[str]] = field(default_factory=list) """ New tags to assign to the private network interface. diff --git a/scaleway/scaleway/kafka/v1alpha1/api.py b/scaleway/scaleway/kafka/v1alpha1/api.py index ea157cd8b..eb8231d10 100644 --- a/scaleway/scaleway/kafka/v1alpha1/api.py +++ b/scaleway/scaleway/kafka/v1alpha1/api.py @@ -464,6 +464,7 @@ def update_cluster( name: Optional[str] = None, tags: Optional[list[str]] = None, version: Optional[str] = None, + volume_size_bytes: Optional[int] = None, ) -> Cluster: """ Update a Kafka cluster. @@ -473,6 +474,7 @@ def update_cluster( :param name: Name of the Kafka Cluster. :param tags: Tags of a Kafka Cluster. :param version: Version of Kafka. + :param volume_size_bytes: New volume size for each broker, can only increase. :return: :class:`Cluster ` Usage: @@ -498,6 +500,7 @@ def update_cluster( name=name, tags=tags, version=version, + volume_size_bytes=volume_size_bytes, ), self.client, ), diff --git a/scaleway/scaleway/kafka/v1alpha1/marshalling.py b/scaleway/scaleway/kafka/v1alpha1/marshalling.py index 3843ac37c..1fd64de38 100644 --- a/scaleway/scaleway/kafka/v1alpha1/marshalling.py +++ b/scaleway/scaleway/kafka/v1alpha1/marshalling.py @@ -929,6 +929,9 @@ def marshal_UpdateClusterRequest( if request.version is not None: output["version"] = request.version + if request.volume_size_bytes is not None: + output["volume_size_bytes"] = request.volume_size_bytes + return output diff --git a/scaleway/scaleway/kafka/v1alpha1/types.py b/scaleway/scaleway/kafka/v1alpha1/types.py index 5bdbd0296..529f3890f 100644 --- a/scaleway/scaleway/kafka/v1alpha1/types.py +++ b/scaleway/scaleway/kafka/v1alpha1/types.py @@ -738,6 +738,11 @@ class UpdateClusterRequest: Version of Kafka. """ + volume_size_bytes: Optional[int] = 0 + """ + New volume size for each broker, can only increase. + """ + @dataclass class UpdateUserRequest: diff --git a/scaleway/scaleway/lb/v1/marshalling.py b/scaleway/scaleway/lb/v1/marshalling.py index 6adbe36e8..61a558806 100644 --- a/scaleway/scaleway/lb/v1/marshalling.py +++ b/scaleway/scaleway/lb/v1/marshalling.py @@ -173,6 +173,12 @@ def unmarshal_Ip(data: Any) -> Ip: else: args["zone"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("lb_id", None) if field is not None: args["lb_id"] = field @@ -242,6 +248,18 @@ def unmarshal_Subscriber(data: Any) -> Subscriber: else: args["name"] = None + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("email_config", None) if field is not None: args["email_config"] = unmarshal_SubscriberEmailConfig(field) @@ -650,6 +668,12 @@ def unmarshal_Lb(data: Any) -> Lb: else: args["zone"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("subscriber", None) if field is not None: args["subscriber"] = unmarshal_Subscriber(field) @@ -733,18 +757,6 @@ def unmarshal_Backend(data: Any) -> Backend: else: args["pool"] = [] - field = data.get("on_marked_down_action", None) - if field is not None: - args["on_marked_down_action"] = field - else: - args["on_marked_down_action"] = OnMarkedDownAction.ON_MARKED_DOWN_ACTION_NONE - - field = data.get("proxy_protocol", None) - if field is not None: - args["proxy_protocol"] = field - else: - args["proxy_protocol"] = ProxyProtocol.PROXY_PROTOCOL_UNKNOWN - field = data.get("health_check", None) if field is not None: args["health_check"] = unmarshal_HealthCheck(field) @@ -781,6 +793,18 @@ def unmarshal_Backend(data: Any) -> Backend: else: args["timeout_tunnel"] = None + field = data.get("on_marked_down_action", None) + if field is not None: + args["on_marked_down_action"] = field + else: + args["on_marked_down_action"] = OnMarkedDownAction.ON_MARKED_DOWN_ACTION_NONE + + field = data.get("proxy_protocol", None) + if field is not None: + args["proxy_protocol"] = field + else: + args["proxy_protocol"] = ProxyProtocol.PROXY_PROTOCOL_UNKNOWN + field = data.get("created_at", None) if field is not None: args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field @@ -811,6 +835,18 @@ def unmarshal_Backend(data: Any) -> Backend: else: args["ignore_ssl_server_verify"] = False + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("redispatch_attempt_count", None) if field is not None: args["redispatch_attempt_count"] = field @@ -916,6 +952,18 @@ def unmarshal_Certificate(data: Any) -> Certificate: else: args["name"] = None + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("created_at", None) if field is not None: args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field @@ -969,6 +1017,12 @@ def unmarshal_Frontend(data: Any) -> Frontend: else: args["certificate_ids"] = [] + field = data.get("enable_http3", None) + if field is not None: + args["enable_http3"] = field + else: + args["enable_http3"] = False + field = data.get("backend", None) if field is not None: args["backend"] = unmarshal_Backend(field) @@ -987,18 +1041,24 @@ def unmarshal_Frontend(data: Any) -> Frontend: else: args["timeout_client"] = None - field = data.get("enable_http3", None) - if field is not None: - args["enable_http3"] = field - else: - args["enable_http3"] = False - field = data.get("enable_access_logs", None) if field is not None: args["enable_access_logs"] = field else: args["enable_access_logs"] = False + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("certificate", None) if field is not None: args["certificate"] = unmarshal_Certificate(field) @@ -1157,6 +1217,18 @@ def unmarshal_Acl(data: Any) -> Acl: else: args["description"] = None + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("match", None) if field is not None: args["match"] = unmarshal_AclMatch(field) @@ -1361,6 +1433,18 @@ def unmarshal_Route(data: Any) -> Route: else: args["backend_id"] = None + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("match", None) if field is not None: args["match"] = unmarshal_RouteMatch(field) @@ -1669,6 +1753,12 @@ def unmarshal_LbType(data: Any) -> LbType: else: args["zone"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("region", None) if field is not None: args["region"] = field diff --git a/scaleway/scaleway/lb/v1/types.py b/scaleway/scaleway/lb/v1/types.py index 08a0ed3fc..a695b239e 100644 --- a/scaleway/scaleway/lb/v1/types.py +++ b/scaleway/scaleway/lb/v1/types.py @@ -451,6 +451,11 @@ class Ip: The zone the IP address is in. """ + srn: str + """ + The SRN of the IP address. + """ + lb_id: Optional[str] = None """ Load Balancer ID. @@ -478,6 +483,16 @@ class Subscriber: Subscriber name. """ + zone: ScwZone + """ + The zone the subscriber is in. + """ + + srn: str + """ + The SRN of the subscriber. + """ + email_config: Optional[SubscriberEmailConfig] = None webhook_config: Optional[SubscriberWebhookConfig] = None @@ -612,6 +627,11 @@ class Lb: The zone the Load Balancer is in. """ + srn: str + """ + The SRN of the Load Balancer. + """ + subscriber: Optional[Subscriber] = None """ Subscriber information. @@ -703,6 +723,16 @@ class Backend: Protocol to use between the Load Balancer and backend servers. Allows the backend servers to be informed of the client's real IP address. The PROXY protocol must be supported by the backend servers' software. """ + zone: ScwZone + """ + The zone the backend is in. + """ + + srn: str + """ + The SRN of the backend. + """ + health_check: Optional[HealthCheck] = None """ Object defining the health check to be carried out by the backend when checking the status and health of backend servers. @@ -821,6 +851,16 @@ class Certificate: Certificate name. """ + zone: ScwZone + """ + The zone the certificate is in. + """ + + srn: str + """ + The SRN of the certificate. + """ + not_valid_before: Optional[datetime] = None """ Lower validity bound. @@ -930,6 +970,16 @@ class Frontend: Defines whether to enable access logs on the frontend. """ + zone: ScwZone + """ + The zone the frontend is in. + """ + + srn: str + """ + The SRN of the frontend. + """ + backend: Optional[Backend] = None """ Backend object the frontend is attached to. @@ -1074,6 +1124,16 @@ class Acl: ACL description. """ + zone: ScwZone + """ + The zone the ACL is in. + """ + + srn: str + """ + The SRN of the ACL. + """ + match: Optional[AclMatch] = None """ ACL match filter object. One of `ip_subnet`, `ips_edge_services` or `http_filter` & `http_filter_value` are required. @@ -1171,6 +1231,11 @@ class LbType: The zone the Load Balancer stock is in. """ + srn: str + """ + The SRN of the Load Balancer offer type. + """ + region: Optional[ScwRegion] = None """ The region the Load Balancer stock is in. @@ -1194,6 +1259,16 @@ class Route: ID of the target backend. """ + zone: ScwZone + """ + The zone the route is in. + """ + + srn: str + """ + The SRN of the route. + """ + match: Optional[RouteMatch] = None """ Object defining the match condition for a route to be applied. If an incoming client session matches the specified condition (i.e. it has a matching SNI value or HTTP Host header value), it will be passed to the target backend. diff --git a/scaleway/scaleway/partner/v1/marshalling.py b/scaleway/scaleway/partner/v1/marshalling.py index 89638845c..3c029b07d 100644 --- a/scaleway/scaleway/partner/v1/marshalling.py +++ b/scaleway/scaleway/partner/v1/marshalling.py @@ -96,6 +96,12 @@ def unmarshal_Organization(data: Any) -> Organization: else: args["comment"] = None + field = data.get("srn", None) + if field is not None: + args["srn"] = field + else: + args["srn"] = None + field = data.get("locked_at", None) if field is not None: args["locked_at"] = parser.isoparse(field) if isinstance(field, str) else field diff --git a/scaleway/scaleway/partner/v1/types.py b/scaleway/scaleway/partner/v1/types.py index f929e2dce..85414908a 100644 --- a/scaleway/scaleway/partner/v1/types.py +++ b/scaleway/scaleway/partner/v1/types.py @@ -91,6 +91,11 @@ class Organization: A comment about the organization. """ + srn: str + """ + The SRN of the organization. + """ + created_at: Optional[datetime] = None """ Date of organization creation.