From 8a23f13293f2da5556576e9fc424db5367fb1fbb Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Tue, 13 May 2025 14:30:37 +0000 Subject: [PATCH] feat: update generated APIs --- scaleway-async/scaleway_async/cockpit/v1/api.py | 5 ++++- .../scaleway_async/cockpit/v1/marshalling.py | 4 ++++ scaleway-async/scaleway_async/cockpit/v1/types.py | 10 ++++++++++ scaleway/scaleway/cockpit/v1/api.py | 5 ++++- scaleway/scaleway/cockpit/v1/marshalling.py | 4 ++++ scaleway/scaleway/cockpit/v1/types.py | 10 ++++++++++ 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/scaleway-async/scaleway_async/cockpit/v1/api.py b/scaleway-async/scaleway_async/cockpit/v1/api.py index b04779176..a7a8f1671 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/api.py +++ b/scaleway-async/scaleway_async/cockpit/v1/api.py @@ -591,7 +591,7 @@ async def get_current_plan( class CockpitV1RegionalAPI(API): """ - The Cockpit Regional API allows you to create data sources and tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager. + The Cockpit API allows you to create data sources and Cockpit tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager. """ async def get_config( @@ -1446,6 +1446,7 @@ async def list_alerts( is_enabled: Optional[bool] = None, is_preconfigured: Optional[bool] = None, state: Optional[AlertState] = None, + data_source_id: Optional[str] = None, ) -> ListAlertsResponse: """ List alerts. @@ -1455,6 +1456,7 @@ async def list_alerts( :param is_enabled: True returns only enabled alerts. False returns only disabled alerts. If omitted, no alert filtering is applied. Other filters may still apply. :param is_preconfigured: True returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply. :param state: Valid values to filter on are `inactive`, `pending` and `firing`. If omitted, no filtering is applied on alert states. Other filters may still apply. + :param data_source_id: If omitted, only alerts from the default scaleway data source will be listed. :return: :class:`ListAlertsResponse ` Usage: @@ -1471,6 +1473,7 @@ async def list_alerts( "GET", f"/cockpit/v1/regions/{param_region}/alerts", params={ + "data_source_id": data_source_id, "is_enabled": is_enabled, "is_preconfigured": is_preconfigured, "project_id": project_id or self.client.default_project_id, diff --git a/scaleway-async/scaleway_async/cockpit/v1/marshalling.py b/scaleway-async/scaleway_async/cockpit/v1/marshalling.py index 5e5a39c57..ae31225c3 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/marshalling.py +++ b/scaleway-async/scaleway_async/cockpit/v1/marshalling.py @@ -509,6 +509,10 @@ def unmarshal_Alert(data: Any) -> Alert: if field is not None: args["annotations"] = field + field = data.get("data_source_id", None) + if field is not None: + args["data_source_id"] = field + field = data.get("state", None) if field is not None: args["state"] = field diff --git a/scaleway-async/scaleway_async/cockpit/v1/types.py b/scaleway-async/scaleway_async/cockpit/v1/types.py index f09edbbaa..17ca2ebe8 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/types.py +++ b/scaleway-async/scaleway_async/cockpit/v1/types.py @@ -204,6 +204,11 @@ class Alert: Annotations for the alert, used to provide additional information about the alert. """ + data_source_id: str + """ + ID of the data source containing the alert rule. + """ + state: Optional[AlertState] """ Current state of the alert. Possible states are `inactive`, `pending`, and `firing`. @@ -1239,6 +1244,11 @@ class RegionalApiListAlertsRequest: Valid values to filter on are `inactive`, `pending` and `firing`. If omitted, no filtering is applied on alert states. Other filters may still apply. """ + data_source_id: Optional[str] + """ + If omitted, only alerts from the default scaleway data source will be listed. + """ + @dataclass class RegionalApiListContactPointsRequest: diff --git a/scaleway/scaleway/cockpit/v1/api.py b/scaleway/scaleway/cockpit/v1/api.py index 0f38fcaa8..2f986204a 100644 --- a/scaleway/scaleway/cockpit/v1/api.py +++ b/scaleway/scaleway/cockpit/v1/api.py @@ -591,7 +591,7 @@ def get_current_plan( class CockpitV1RegionalAPI(API): """ - The Cockpit Regional API allows you to create data sources and tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager. + The Cockpit API allows you to create data sources and Cockpit tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager. """ def get_config( @@ -1446,6 +1446,7 @@ def list_alerts( is_enabled: Optional[bool] = None, is_preconfigured: Optional[bool] = None, state: Optional[AlertState] = None, + data_source_id: Optional[str] = None, ) -> ListAlertsResponse: """ List alerts. @@ -1455,6 +1456,7 @@ def list_alerts( :param is_enabled: True returns only enabled alerts. False returns only disabled alerts. If omitted, no alert filtering is applied. Other filters may still apply. :param is_preconfigured: True returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply. :param state: Valid values to filter on are `inactive`, `pending` and `firing`. If omitted, no filtering is applied on alert states. Other filters may still apply. + :param data_source_id: If omitted, only alerts from the default scaleway data source will be listed. :return: :class:`ListAlertsResponse ` Usage: @@ -1471,6 +1473,7 @@ def list_alerts( "GET", f"/cockpit/v1/regions/{param_region}/alerts", params={ + "data_source_id": data_source_id, "is_enabled": is_enabled, "is_preconfigured": is_preconfigured, "project_id": project_id or self.client.default_project_id, diff --git a/scaleway/scaleway/cockpit/v1/marshalling.py b/scaleway/scaleway/cockpit/v1/marshalling.py index 5e5a39c57..ae31225c3 100644 --- a/scaleway/scaleway/cockpit/v1/marshalling.py +++ b/scaleway/scaleway/cockpit/v1/marshalling.py @@ -509,6 +509,10 @@ def unmarshal_Alert(data: Any) -> Alert: if field is not None: args["annotations"] = field + field = data.get("data_source_id", None) + if field is not None: + args["data_source_id"] = field + field = data.get("state", None) if field is not None: args["state"] = field diff --git a/scaleway/scaleway/cockpit/v1/types.py b/scaleway/scaleway/cockpit/v1/types.py index f09edbbaa..17ca2ebe8 100644 --- a/scaleway/scaleway/cockpit/v1/types.py +++ b/scaleway/scaleway/cockpit/v1/types.py @@ -204,6 +204,11 @@ class Alert: Annotations for the alert, used to provide additional information about the alert. """ + data_source_id: str + """ + ID of the data source containing the alert rule. + """ + state: Optional[AlertState] """ Current state of the alert. Possible states are `inactive`, `pending`, and `firing`. @@ -1239,6 +1244,11 @@ class RegionalApiListAlertsRequest: Valid values to filter on are `inactive`, `pending` and `firing`. If omitted, no filtering is applied on alert states. Other filters may still apply. """ + data_source_id: Optional[str] + """ + If omitted, only alerts from the default scaleway data source will be listed. + """ + @dataclass class RegionalApiListContactPointsRequest: