Skip to content

Commit 2223831

Browse files
authored
Merge branch 'main' into v1.6519.0
2 parents 5fb803a + 643b00f commit 2223831

File tree

12 files changed

+156
-2
lines changed

12 files changed

+156
-2
lines changed

scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# If you have any remark or suggestion do not hesitate to open an issue.
33
from .types import ListEventsRequestOrderBy
44
from .types import ResourceType
5+
from .types import AccountOrganizationInfo
6+
from .types import AccountUserInfo
57
from .types import KeyManagerKeyInfo
68
from .types import KubernetesACLInfo
79
from .types import KubernetesClusterInfo
@@ -23,6 +25,8 @@
2325
__all__ = [
2426
"ListEventsRequestOrderBy",
2527
"ResourceType",
28+
"AccountOrganizationInfo",
29+
"AccountUserInfo",
2630
"KeyManagerKeyInfo",
2731
"KubernetesACLInfo",
2832
"KubernetesClusterInfo",

scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from dateutil import parser
66

77
from .types import (
8+
AccountOrganizationInfo,
9+
AccountUserInfo,
810
KeyManagerKeyInfo,
911
KubernetesACLInfo,
1012
KubernetesClusterInfo,
@@ -22,6 +24,32 @@
2224
)
2325

2426

27+
def unmarshal_AccountOrganizationInfo(data: Any) -> AccountOrganizationInfo:
28+
if not isinstance(data, dict):
29+
raise TypeError(
30+
"Unmarshalling the type 'AccountOrganizationInfo' failed as data isn't a dictionary."
31+
)
32+
33+
args: Dict[str, Any] = {}
34+
35+
return AccountOrganizationInfo(**args)
36+
37+
38+
def unmarshal_AccountUserInfo(data: Any) -> AccountUserInfo:
39+
if not isinstance(data, dict):
40+
raise TypeError(
41+
"Unmarshalling the type 'AccountUserInfo' failed as data isn't a dictionary."
42+
)
43+
44+
args: Dict[str, Any] = {}
45+
46+
field = data.get("email", None)
47+
if field is not None:
48+
args["email"] = field
49+
50+
return AccountUserInfo(**args)
51+
52+
2553
def unmarshal_KeyManagerKeyInfo(data: Any) -> KeyManagerKeyInfo:
2654
if not isinstance(data, dict):
2755
raise TypeError(
@@ -244,6 +272,18 @@ def unmarshal_Resource(data: Any) -> Resource:
244272
else:
245273
args["key_manager_key_info"] = None
246274

275+
field = data.get("account_user_info", None)
276+
if field is not None:
277+
args["account_user_info"] = unmarshal_AccountUserInfo(field)
278+
else:
279+
args["account_user_info"] = None
280+
281+
field = data.get("account_organization_info", None)
282+
if field is not None:
283+
args["account_organization_info"] = unmarshal_AccountOrganizationInfo(field)
284+
else:
285+
args["account_organization_info"] = None
286+
247287
return Resource(**args)
248288

249289

scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,23 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
4242
SECRET_MANAGER_SECRET = "secret_manager_secret"
4343
SECRET_MANAGER_VERSION = "secret_manager_version"
4444
KEY_MANAGER_KEY = "key_manager_key"
45+
ACCOUNT_USER = "account_user"
46+
ACCOUNT_ORGANIZATION = "account_organization"
4547

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

4951

52+
@dataclass
53+
class AccountOrganizationInfo:
54+
pass
55+
56+
57+
@dataclass
58+
class AccountUserInfo:
59+
email: str
60+
61+
5062
@dataclass
5163
class KeyManagerKeyInfo:
5264
pass
@@ -125,6 +137,10 @@ class Resource:
125137

126138
key_manager_key_info: Optional[KeyManagerKeyInfo]
127139

140+
account_user_info: Optional[AccountUserInfo]
141+
142+
account_organization_info: Optional[AccountOrganizationInfo]
143+
128144

129145
@dataclass
130146
class ProductService:

scaleway-async/scaleway_async/cockpit/v1/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ async def get_current_plan(
591591

592592
class CockpitV1RegionalAPI(API):
593593
"""
594-
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.
594+
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.
595595
"""
596596

597597
async def get_config(
@@ -1446,6 +1446,7 @@ async def list_alerts(
14461446
is_enabled: Optional[bool] = None,
14471447
is_preconfigured: Optional[bool] = None,
14481448
state: Optional[AlertState] = None,
1449+
data_source_id: Optional[str] = None,
14491450
) -> ListAlertsResponse:
14501451
"""
14511452
List alerts.
@@ -1455,6 +1456,7 @@ async def list_alerts(
14551456
: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.
14561457
: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.
14571458
: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.
1459+
:param data_source_id: If omitted, only alerts from the default scaleway data source will be listed.
14581460
:return: :class:`ListAlertsResponse <ListAlertsResponse>`
14591461
14601462
Usage:
@@ -1471,6 +1473,7 @@ async def list_alerts(
14711473
"GET",
14721474
f"/cockpit/v1/regions/{param_region}/alerts",
14731475
params={
1476+
"data_source_id": data_source_id,
14741477
"is_enabled": is_enabled,
14751478
"is_preconfigured": is_preconfigured,
14761479
"project_id": project_id or self.client.default_project_id,

scaleway-async/scaleway_async/cockpit/v1/marshalling.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,10 @@ def unmarshal_Alert(data: Any) -> Alert:
509509
if field is not None:
510510
args["annotations"] = field
511511

512+
field = data.get("data_source_id", None)
513+
if field is not None:
514+
args["data_source_id"] = field
515+
512516
field = data.get("state", None)
513517
if field is not None:
514518
args["state"] = field

scaleway-async/scaleway_async/cockpit/v1/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ class Alert:
204204
Annotations for the alert, used to provide additional information about the alert.
205205
"""
206206

207+
data_source_id: str
208+
"""
209+
ID of the data source containing the alert rule.
210+
"""
211+
207212
state: Optional[AlertState]
208213
"""
209214
Current state of the alert. Possible states are `inactive`, `pending`, and `firing`.
@@ -1239,6 +1244,11 @@ class RegionalApiListAlertsRequest:
12391244
Valid values to filter on are `inactive`, `pending` and `firing`. If omitted, no filtering is applied on alert states. Other filters may still apply.
12401245
"""
12411246

1247+
data_source_id: Optional[str]
1248+
"""
1249+
If omitted, only alerts from the default scaleway data source will be listed.
1250+
"""
1251+
12421252

12431253
@dataclass
12441254
class RegionalApiListContactPointsRequest:

scaleway/scaleway/audit_trail/v1alpha1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# If you have any remark or suggestion do not hesitate to open an issue.
33
from .types import ListEventsRequestOrderBy
44
from .types import ResourceType
5+
from .types import AccountOrganizationInfo
6+
from .types import AccountUserInfo
57
from .types import KeyManagerKeyInfo
68
from .types import KubernetesACLInfo
79
from .types import KubernetesClusterInfo
@@ -23,6 +25,8 @@
2325
__all__ = [
2426
"ListEventsRequestOrderBy",
2527
"ResourceType",
28+
"AccountOrganizationInfo",
29+
"AccountUserInfo",
2630
"KeyManagerKeyInfo",
2731
"KubernetesACLInfo",
2832
"KubernetesClusterInfo",

scaleway/scaleway/audit_trail/v1alpha1/marshalling.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from dateutil import parser
66

77
from .types import (
8+
AccountOrganizationInfo,
9+
AccountUserInfo,
810
KeyManagerKeyInfo,
911
KubernetesACLInfo,
1012
KubernetesClusterInfo,
@@ -22,6 +24,32 @@
2224
)
2325

2426

27+
def unmarshal_AccountOrganizationInfo(data: Any) -> AccountOrganizationInfo:
28+
if not isinstance(data, dict):
29+
raise TypeError(
30+
"Unmarshalling the type 'AccountOrganizationInfo' failed as data isn't a dictionary."
31+
)
32+
33+
args: Dict[str, Any] = {}
34+
35+
return AccountOrganizationInfo(**args)
36+
37+
38+
def unmarshal_AccountUserInfo(data: Any) -> AccountUserInfo:
39+
if not isinstance(data, dict):
40+
raise TypeError(
41+
"Unmarshalling the type 'AccountUserInfo' failed as data isn't a dictionary."
42+
)
43+
44+
args: Dict[str, Any] = {}
45+
46+
field = data.get("email", None)
47+
if field is not None:
48+
args["email"] = field
49+
50+
return AccountUserInfo(**args)
51+
52+
2553
def unmarshal_KeyManagerKeyInfo(data: Any) -> KeyManagerKeyInfo:
2654
if not isinstance(data, dict):
2755
raise TypeError(
@@ -244,6 +272,18 @@ def unmarshal_Resource(data: Any) -> Resource:
244272
else:
245273
args["key_manager_key_info"] = None
246274

275+
field = data.get("account_user_info", None)
276+
if field is not None:
277+
args["account_user_info"] = unmarshal_AccountUserInfo(field)
278+
else:
279+
args["account_user_info"] = None
280+
281+
field = data.get("account_organization_info", None)
282+
if field is not None:
283+
args["account_organization_info"] = unmarshal_AccountOrganizationInfo(field)
284+
else:
285+
args["account_organization_info"] = None
286+
247287
return Resource(**args)
248288

249289

scaleway/scaleway/audit_trail/v1alpha1/types.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,23 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
4242
SECRET_MANAGER_SECRET = "secret_manager_secret"
4343
SECRET_MANAGER_VERSION = "secret_manager_version"
4444
KEY_MANAGER_KEY = "key_manager_key"
45+
ACCOUNT_USER = "account_user"
46+
ACCOUNT_ORGANIZATION = "account_organization"
4547

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

4951

52+
@dataclass
53+
class AccountOrganizationInfo:
54+
pass
55+
56+
57+
@dataclass
58+
class AccountUserInfo:
59+
email: str
60+
61+
5062
@dataclass
5163
class KeyManagerKeyInfo:
5264
pass
@@ -125,6 +137,10 @@ class Resource:
125137

126138
key_manager_key_info: Optional[KeyManagerKeyInfo]
127139

140+
account_user_info: Optional[AccountUserInfo]
141+
142+
account_organization_info: Optional[AccountOrganizationInfo]
143+
128144

129145
@dataclass
130146
class ProductService:

scaleway/scaleway/cockpit/v1/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def get_current_plan(
591591

592592
class CockpitV1RegionalAPI(API):
593593
"""
594-
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.
594+
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.
595595
"""
596596

597597
def get_config(
@@ -1446,6 +1446,7 @@ def list_alerts(
14461446
is_enabled: Optional[bool] = None,
14471447
is_preconfigured: Optional[bool] = None,
14481448
state: Optional[AlertState] = None,
1449+
data_source_id: Optional[str] = None,
14491450
) -> ListAlertsResponse:
14501451
"""
14511452
List alerts.
@@ -1455,6 +1456,7 @@ def list_alerts(
14551456
: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.
14561457
: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.
14571458
: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.
1459+
:param data_source_id: If omitted, only alerts from the default scaleway data source will be listed.
14581460
:return: :class:`ListAlertsResponse <ListAlertsResponse>`
14591461
14601462
Usage:
@@ -1471,6 +1473,7 @@ def list_alerts(
14711473
"GET",
14721474
f"/cockpit/v1/regions/{param_region}/alerts",
14731475
params={
1476+
"data_source_id": data_source_id,
14741477
"is_enabled": is_enabled,
14751478
"is_preconfigured": is_preconfigured,
14761479
"project_id": project_id or self.client.default_project_id,

0 commit comments

Comments
 (0)