Skip to content

Commit 2fcc599

Browse files
feat(audit_trail): add support for service_name (scaleway#891)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent cfd074e commit 2fcc599

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ async def list_events(
4343
page_size: Optional[int] = None,
4444
page_token: Optional[str] = None,
4545
product_name: Optional[str] = None,
46+
service_name: Optional[str] = None,
4647
) -> ListEventsResponse:
4748
"""
4849
List events.
@@ -51,14 +52,15 @@ async def list_events(
5152
:param project_id: (Optional) ID of the Project containing the Audit Trail events.
5253
:param organization_id: ID of the Organization containing the Audit Trail events.
5354
:param resource_type: (Optional) Returns a paginated list of Scaleway resources' features.
54-
:param method_name: (Optional) Name of the method or the API call performed.
55+
:param method_name: (Optional) Name of the method of the API call performed.
5556
:param status: (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied.
5657
: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.
5758
:param recorded_before: (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default.
5859
:param order_by:
5960
:param page_size:
6061
:param page_token:
6162
:param product_name: (Optional) Name of the Scaleway resource in a hyphenated format.
63+
:param service_name: (Optional) Name of the service of the API call performed.
6264
:return: :class:`ListEventsResponse <ListEventsResponse>`
6365
6466
Usage:
@@ -86,6 +88,7 @@ async def list_events(
8688
"recorded_after": recorded_after,
8789
"recorded_before": recorded_before,
8890
"resource_type": resource_type,
91+
"service_name": service_name,
8992
"status": status,
9093
},
9194
)

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class ListEventsRequest:
257257

258258
method_name: Optional[str]
259259
"""
260-
(Optional) Name of the method or the API call performed.
260+
(Optional) Name of the method of the API call performed.
261261
"""
262262

263263
status: Optional[int]
@@ -286,6 +286,11 @@ class ListEventsRequest:
286286
(Optional) Name of the Scaleway resource in a hyphenated format.
287287
"""
288288

289+
service_name: Optional[str]
290+
"""
291+
(Optional) Name of the service of the API call performed.
292+
"""
293+
289294

290295
@dataclass
291296
class ListEventsResponse:

scaleway/scaleway/audit_trail/v1alpha1/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def list_events(
4343
page_size: Optional[int] = None,
4444
page_token: Optional[str] = None,
4545
product_name: Optional[str] = None,
46+
service_name: Optional[str] = None,
4647
) -> ListEventsResponse:
4748
"""
4849
List events.
@@ -51,14 +52,15 @@ def list_events(
5152
:param project_id: (Optional) ID of the Project containing the Audit Trail events.
5253
:param organization_id: ID of the Organization containing the Audit Trail events.
5354
:param resource_type: (Optional) Returns a paginated list of Scaleway resources' features.
54-
:param method_name: (Optional) Name of the method or the API call performed.
55+
:param method_name: (Optional) Name of the method of the API call performed.
5556
:param status: (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied.
5657
: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.
5758
:param recorded_before: (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default.
5859
:param order_by:
5960
:param page_size:
6061
:param page_token:
6162
:param product_name: (Optional) Name of the Scaleway resource in a hyphenated format.
63+
:param service_name: (Optional) Name of the service of the API call performed.
6264
:return: :class:`ListEventsResponse <ListEventsResponse>`
6365
6466
Usage:
@@ -86,6 +88,7 @@ def list_events(
8688
"recorded_after": recorded_after,
8789
"recorded_before": recorded_before,
8890
"resource_type": resource_type,
91+
"service_name": service_name,
8992
"status": status,
9093
},
9194
)

scaleway/scaleway/audit_trail/v1alpha1/types.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class ListEventsRequest:
257257

258258
method_name: Optional[str]
259259
"""
260-
(Optional) Name of the method or the API call performed.
260+
(Optional) Name of the method of the API call performed.
261261
"""
262262

263263
status: Optional[int]
@@ -286,6 +286,11 @@ class ListEventsRequest:
286286
(Optional) Name of the Scaleway resource in a hyphenated format.
287287
"""
288288

289+
service_name: Optional[str]
290+
"""
291+
(Optional) Name of the service of the API call performed.
292+
"""
293+
289294

290295
@dataclass
291296
class ListEventsResponse:

0 commit comments

Comments
 (0)