Skip to content
Merged
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
3 changes: 3 additions & 0 deletions scaleway-async/scaleway_async/cockpit/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 <ListAlertsResponse>`
Usage:
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions scaleway-async/scaleway_async/cockpit/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions scaleway-async/scaleway_async/cockpit/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions scaleway/scaleway/cockpit/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 <ListAlertsResponse>`
Usage:
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions scaleway/scaleway/cockpit/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions scaleway/scaleway/cockpit/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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:
Expand Down