Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USAGE:

ARGS:
[project-id] (Optional) ID of the Project containing the Audit Trail events
[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 | iam_rule | secret_manager_secret | secret_manager_version | key_manager_key)
[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 | iam_rule | secret_manager_secret | secret_manager_version | key_manager_key | account_user | account_organization)
[method-name] (Optional) Name of the method of the API call performed
[status] (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied
[recorded-after] (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default
Expand Down
15 changes: 15 additions & 0 deletions cmd/scw/testdata/test-all-usage-iam-organization-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Organization-wide management commands.

USAGE:
scw iam organization

FLAGS:
-h, --help help for organization

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-all-usage-iam-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ AVAILABLE COMMANDS:
group Groups management commands
jwt JWTs management commands
log Log management commands
organization Organization-wide management commands
permission-set Permission sets management commands
policy Policies management commands
rule Rules management commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ARGS:
[order-by] (name_asc | name_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc)
[tags.{index}] (Optional) List of tags to filter on
[name] (Optional) Filter by key name
[usage] (Optional) Filter keys by usage. (unknown_usage | symmetric_encryption | asymmetric_encryption | asymmetric_signing)
[organization-id] (Optional) Filter by Organization ID
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/audit-trail.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ scw audit-trail event list [arg=value ...]
| Name | | Description |
|------|---|-------------|
| project-id | | (Optional) ID of the Project containing the Audit Trail events |
| 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`, `iam_rule`, `secret_manager_secret`, `secret_manager_version`, `key_manager_key` | (Optional) Returns a paginated list of Scaleway resources' features |
| 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`, `iam_rule`, `secret_manager_secret`, `secret_manager_version`, `key_manager_key`, `account_user`, `account_organization` | (Optional) Returns a paginated list of Scaleway resources' features |
| method-name | | (Optional) Name of the method of the API call performed |
| status | | (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied |
| recorded-after | | (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default |
Expand Down
15 changes: 15 additions & 0 deletions docs/commands/iam.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This API allows you to manage Identity and Access Management (IAM) across your S
- [Log management commands](#log-management-commands)
- [Get a log](#get-a-log)
- [List logs](#list-logs)
- [Organization-wide management commands](#organization-wide-management-commands)
- [Permission sets management commands](#permission-sets-management-commands)
- [List permission sets](#list-permission-sets)
- [Policies management commands](#policies-management-commands)
Expand Down Expand Up @@ -628,6 +629,20 @@ scw iam log list [arg=value ...]



## Organization-wide management commands

Organization-wide management commands.

Organization-wide management commands.

**Usage:**

```
scw iam organization
```



## Permission sets management commands

Permission sets management commands.
Expand Down
1 change: 1 addition & 0 deletions docs/commands/keymanager.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ scw keymanager key list [arg=value ...]
| order-by | One of: `name_asc`, `name_desc`, `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc` | |
| tags.{index} | | (Optional) List of tags to filter on |
| name | | (Optional) Filter by key name |
| usage | One of: `unknown_usage`, `symmetric_encryption`, `asymmetric_encryption`, `asymmetric_signing` | (Optional) Filter keys by usage. |
| organization-id | | (Optional) Filter by Organization ID |
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250507151153-c2221170c9cc
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250514090832-f36c46b181ca
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250507151153-c2221170c9cc h1:BG7CJh8I2AuyMP0ie6sOqAGYn5jifL4piKBZCva9C5M=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250507151153-c2221170c9cc/go.mod h1:qiGzapFyNPFwBBLJ+hTFykKSnU95n1zL64+o1ubmwf0=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250514090832-f36c46b181ca h1:xNYnhDQ8TTsjB4m/3uUXRLryvtAETOpkNFOr5t0lq30=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250514090832-f36c46b181ca/go.mod h1:qiGzapFyNPFwBBLJ+hTFykKSnU95n1zL64+o1ubmwf0=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
12 changes: 11 additions & 1 deletion internal/namespaces/iam/v1alpha1/iam_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"reflect"

"github.com/scaleway/scaleway-cli/v2/core"
iam "github.com/scaleway/scaleway-sdk-go/api/iam/v1alpha1"
"github.com/scaleway/scaleway-sdk-go/api/iam/v1alpha1"
"github.com/scaleway/scaleway-sdk-go/scw"
)

Expand All @@ -30,6 +30,7 @@ func GetGeneratedCommands() *core.Commands {
iamPermissionSet(),
iamJwt(),
iamLog(),
iamOrganization(),
iamSSHKeyList(),
iamSSHKeyCreate(),
iamSSHKeyGet(),
Expand Down Expand Up @@ -176,6 +177,15 @@ func iamLog() *core.Command {
}
}

func iamOrganization() *core.Command {
return &core.Command{
Short: `Organization-wide management commands`,
Long: `Organization-wide management commands.`,
Namespace: "iam",
Resource: "organization",
}
}

func iamSSHKeyList() *core.Command {
return &core.Command{
Short: `List SSH keys`,
Expand Down
Loading