Skip to content

Commit e25b12c

Browse files
authored
feat(audit_trail): add ResourceType filter (#1206)
1 parent bcb4662 commit e25b12c

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,25 @@ async def list_events(
4444
page_token: Optional[str] = None,
4545
product_name: Optional[str] = None,
4646
service_name: Optional[str] = None,
47+
resource_id: Optional[str] = None,
4748
) -> ListEventsResponse:
4849
"""
4950
List events.
5051
Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.
5152
:param region: Region to target. If none is passed will use default region from the config.
5253
:param project_id: (Optional) ID of the Project containing the Audit Trail events.
5354
:param organization_id: ID of the Organization containing the Audit Trail events.
54-
:param resource_type: (Optional) Returns a paginated list of Scaleway resources' features.
55+
:param resource_type: (Optional) Type of the Scaleway resource.
5556
:param method_name: (Optional) Name of the method of the API call performed.
5657
:param status: (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied.
5758
:param recorded_after: (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default.
5859
:param recorded_before: (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default.
5960
:param order_by:
6061
:param page_size:
6162
:param page_token:
62-
:param product_name: (Optional) Name of the Scaleway resource in a hyphenated format.
63+
:param product_name: (Optional) Name of the Scaleway product in a hyphenated format.
6364
:param service_name: (Optional) Name of the service of the API call performed.
65+
:param resource_id: (Optional) ID of the Scaleway resource.
6466
:return: :class:`ListEventsResponse <ListEventsResponse>`
6567
6668
Usage:
@@ -87,6 +89,7 @@ async def list_events(
8789
"project_id": project_id or self.client.default_project_id,
8890
"recorded_after": recorded_after,
8991
"recorded_before": recorded_before,
92+
"resource_id": resource_id,
9093
"resource_type": resource_type,
9194
"service_name": service_name,
9295
"status": status,

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class ListEventsRequest:
318318

319319
resource_type: Optional[ResourceType] = ResourceType.UNKNOWN_TYPE
320320
"""
321-
(Optional) Returns a paginated list of Scaleway resources' features.
321+
(Optional) Type of the Scaleway resource.
322322
"""
323323

324324
method_name: Optional[str] = None
@@ -348,14 +348,19 @@ class ListEventsRequest:
348348
page_token: Optional[str] = None
349349
product_name: Optional[str] = None
350350
"""
351-
(Optional) Name of the Scaleway resource in a hyphenated format.
351+
(Optional) Name of the Scaleway product in a hyphenated format.
352352
"""
353353

354354
service_name: Optional[str] = None
355355
"""
356356
(Optional) Name of the service of the API call performed.
357357
"""
358358

359+
resource_id: Optional[str] = None
360+
"""
361+
(Optional) ID of the Scaleway resource.
362+
"""
363+
359364

360365
@dataclass
361366
class ListEventsResponse:

scaleway/scaleway/audit_trail/v1alpha1/api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,25 @@ def list_events(
4444
page_token: Optional[str] = None,
4545
product_name: Optional[str] = None,
4646
service_name: Optional[str] = None,
47+
resource_id: Optional[str] = None,
4748
) -> ListEventsResponse:
4849
"""
4950
List events.
5051
Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.
5152
:param region: Region to target. If none is passed will use default region from the config.
5253
:param project_id: (Optional) ID of the Project containing the Audit Trail events.
5354
:param organization_id: ID of the Organization containing the Audit Trail events.
54-
:param resource_type: (Optional) Returns a paginated list of Scaleway resources' features.
55+
:param resource_type: (Optional) Type of the Scaleway resource.
5556
:param method_name: (Optional) Name of the method of the API call performed.
5657
:param status: (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied.
5758
:param recorded_after: (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default.
5859
:param recorded_before: (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default.
5960
:param order_by:
6061
:param page_size:
6162
:param page_token:
62-
:param product_name: (Optional) Name of the Scaleway resource in a hyphenated format.
63+
:param product_name: (Optional) Name of the Scaleway product in a hyphenated format.
6364
:param service_name: (Optional) Name of the service of the API call performed.
65+
:param resource_id: (Optional) ID of the Scaleway resource.
6466
:return: :class:`ListEventsResponse <ListEventsResponse>`
6567
6668
Usage:
@@ -87,6 +89,7 @@ def list_events(
8789
"project_id": project_id or self.client.default_project_id,
8890
"recorded_after": recorded_after,
8991
"recorded_before": recorded_before,
92+
"resource_id": resource_id,
9093
"resource_type": resource_type,
9194
"service_name": service_name,
9295
"status": status,

scaleway/scaleway/audit_trail/v1alpha1/types.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class ListEventsRequest:
318318

319319
resource_type: Optional[ResourceType] = ResourceType.UNKNOWN_TYPE
320320
"""
321-
(Optional) Returns a paginated list of Scaleway resources' features.
321+
(Optional) Type of the Scaleway resource.
322322
"""
323323

324324
method_name: Optional[str] = None
@@ -348,14 +348,19 @@ class ListEventsRequest:
348348
page_token: Optional[str] = None
349349
product_name: Optional[str] = None
350350
"""
351-
(Optional) Name of the Scaleway resource in a hyphenated format.
351+
(Optional) Name of the Scaleway product in a hyphenated format.
352352
"""
353353

354354
service_name: Optional[str] = None
355355
"""
356356
(Optional) Name of the service of the API call performed.
357357
"""
358358

359+
resource_id: Optional[str] = None
360+
"""
361+
(Optional) ID of the Scaleway resource.
362+
"""
363+
359364

360365
@dataclass
361366
class ListEventsResponse:

0 commit comments

Comments
 (0)