diff --git a/scaleway-async/scaleway_async/cockpit/v1/api.py b/scaleway-async/scaleway_async/cockpit/v1/api.py index b04779176..a8b6246e5 100644 --- a/scaleway-async/scaleway_async/cockpit/v1/api.py +++ b/scaleway-async/scaleway_async/cockpit/v1/api.py @@ -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..b16a508b1 100644 --- a/scaleway/scaleway/cockpit/v1/api.py +++ b/scaleway/scaleway/cockpit/v1/api.py @@ -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: