Skip to content

Commit a4eb6fd

Browse files
feat(audit_trail): add support for service_name (scaleway#4571)
Co-authored-by: Rémy Léone <[email protected]>
1 parent 48ad408 commit a4eb6fd

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

cmd/scw/testdata/test-all-usage-audit-trail-event-list-usage.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ USAGE:
88
ARGS:
99
[project-id] (Optional) ID of the Project containing the Audit Trail events
1010
[resource-type] (Optional) Returns a paginated list of Scaleway resources' features (unknown_type | secm_secret | secm_secret_version | kube_cluster | kube_pool | kube_node | kube_acl | keym_key | iam_user | iam_application | iam_group | iam_policy | iam_api_key | iam_ssh_key | secret_manager_secret | secret_manager_version | key_manager_key)
11-
[method-name] (Optional) Name of the method or the API call performed
11+
[method-name] (Optional) Name of the method of the API call performed
1212
[status] (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied
1313
[recorded-after] (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default
1414
[recorded-before] (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default
1515
[order-by] (recorded_at_desc | recorded_at_asc)
1616
[page-size]
1717
[page-token]
1818
[product-name] (Optional) Name of the Scaleway resource in a hyphenated format
19+
[service-name] (Optional) Name of the service of the API call performed
1920
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
2021
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
2122

docs/commands/audit-trail.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ scw audit-trail event list [arg=value ...]
3030
|------|---|-------------|
3131
| project-id | | (Optional) ID of the Project containing the Audit Trail events |
3232
| resource-type | One of: `unknown_type`, `secm_secret`, `secm_secret_version`, `kube_cluster`, `kube_pool`, `kube_node`, `kube_acl`, `keym_key`, `iam_user`, `iam_application`, `iam_group`, `iam_policy`, `iam_api_key`, `iam_ssh_key`, `secret_manager_secret`, `secret_manager_version`, `key_manager_key` | (Optional) Returns a paginated list of Scaleway resources' features |
33-
| method-name | | (Optional) Name of the method or the API call performed |
33+
| method-name | | (Optional) Name of the method of the API call performed |
3434
| status | | (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied |
3535
| recorded-after | | (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default |
3636
| recorded-before | | (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default |
3737
| order-by | One of: `recorded_at_desc`, `recorded_at_asc` | |
3838
| page-size | | |
3939
| page-token | | |
4040
| product-name | | (Optional) Name of the Scaleway resource in a hyphenated format |
41+
| service-name | | (Optional) Name of the service of the API call performed |
4142
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
4243
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams` | Region to target. If none is passed will use default region from the config |
4344

internal/namespaces/audit_trail/v1alpha1/audit_trail_cli.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func auditTrailEventList() *core.Command {
7979
},
8080
{
8181
Name: "method-name",
82-
Short: `(Optional) Name of the method or the API call performed`,
82+
Short: `(Optional) Name of the method of the API call performed`,
8383
Required: false,
8484
Deprecated: false,
8585
Positional: false,
@@ -131,6 +131,13 @@ func auditTrailEventList() *core.Command {
131131
Deprecated: false,
132132
Positional: false,
133133
},
134+
{
135+
Name: "service-name",
136+
Short: `(Optional) Name of the service of the API call performed`,
137+
Required: false,
138+
Deprecated: false,
139+
Positional: false,
140+
},
134141
core.OrganizationIDArgSpec(),
135142
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms),
136143
},

0 commit comments

Comments
 (0)