Skip to content

Commit

Permalink
Merge branch 'master' into project_in_access_key
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored Feb 25, 2025
2 parents 18d2c7b + 8d67cdf commit 4fbc99c
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 24 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/purge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Manual Purge
on:
workflow_dispatch:

jobs:
sweepers:
runs-on: ubuntu-latest
steps:
# Checkout should always be before setup-go to ensure caching is working
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24
- name: Run Sweepers
run: go run -v ./cmd/scw-sweeper
env:
SCW_DEBUG: 1
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
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 | iamx_user | iamx_application | iamx_group | iamx_policy | iamx_api_key | iamx_ssh_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)
[method-name] (Optional) Name of the method or 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ARGS:
[project-id] Filter by Project ID
[volume-id] Filter snapshots by the ID of the original volume
[name] Filter snapshots by their names
[tags.{index}] Filter by tags. Only snapshots with one or more matching tags will be returned
[organization-id] Filter by Organization ID
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3 | all)

Expand Down
19 changes: 10 additions & 9 deletions cmd/scw/testdata/test-all-usage-secret-secret-list-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ USAGE:
scw secret secret list [arg=value ...]

ARGS:
[project-id] Filter by Project ID (optional)
[order-by] (name_asc | name_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc)
[tags.{index}] List of tags to filter on (optional)
[name] Filter by secret name (optional)
[path] Filter by exact path (optional)
[ephemeral] Filter by ephemeral / not ephemeral (optional)
[type] Filter by secret type (optional) (unknown_type | opaque | certificate | key_value | basic_credentials | database_credentials | ssh_key)
[organization-id] Filter by Organization ID (optional)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
[project-id] Filter by Project ID (optional)
[order-by] (name_asc | name_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc)
[tags.{index}] List of tags to filter on (optional)
[name] Filter by secret name (optional)
[path] Filter by exact path (optional)
[ephemeral] Filter by ephemeral / not ephemeral (optional)
[type] Filter by secret type (optional) (unknown_type | opaque | certificate | key_value | basic_credentials | database_credentials | ssh_key)
[scheduled-for-deletion] Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional)
[organization-id] Filter by Organization ID (optional)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)

FLAGS:
-h, --help help for list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USAGE:

ARGS:
secret-id ID of the secret
[status.{index}] Filter results by status (unknown_status | enabled | disabled | deleted)
[status.{index}] Filter results by status (unknown_status | enabled | disabled | deleted | scheduled_for_deletion)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)

FLAGS:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Project consumption allow you to see your project consumption.

USAGE:
scw tem project-consumption

FLAGS:
-h, --help help for project-consumption

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
13 changes: 7 additions & 6 deletions cmd/scw/testdata/test-all-usage-tem-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ USAGE:
scw tem <command>

AVAILABLE COMMANDS:
blocklists Blocklist
domain Domain management commands
email Email management commands
offers Project offers management commands
project-settings Project settings management commands
webhook Webhook management commands
blocklists Blocklist
domain Domain management commands
email Email management commands
offers Project offers management commands
project-consumption Project consumption management commands
project-settings Project settings management commands
webhook Webhook management commands

FLAGS:
-h, --help help for tem
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`, `iamx_user`, `iamx_application`, `iamx_group`, `iamx_policy`, `iamx_api_key`, `iamx_ssh_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` | (Optional) Returns a paginated list of Scaleway resources' features |
| method-name | | (Optional) Name of the method or 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
1 change: 1 addition & 0 deletions docs/commands/block.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ scw block snapshot list [arg=value ...]
| project-id | | Filter by Project ID |
| volume-id | | Filter snapshots by the ID of the original volume |
| name | | Filter snapshots by their names |
| tags.{index} | | Filter by tags. Only snapshots with one or more matching tags will be returned |
| organization-id | | Filter by Organization ID |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2`, `pl-waw-3`, `all` | Zone to target. If none is passed will use default zone from the config |

Expand Down
3 changes: 2 additions & 1 deletion docs/commands/secret.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ scw secret secret list [arg=value ...]
| path | | Filter by exact path (optional) |
| ephemeral | | Filter by ephemeral / not ephemeral (optional) |
| type | One of: `unknown_type`, `opaque`, `certificate`, `key_value`, `basic_credentials`, `database_credentials`, `ssh_key` | Filter by secret type (optional) |
| scheduled-for-deletion | | Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional) |
| organization-id | | Filter by Organization ID (optional) |
| 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 Expand Up @@ -457,7 +458,7 @@ scw secret version list <secret-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| secret-id | Required | ID of the secret |
| status.{index} | One of: `unknown_status`, `enabled`, `disabled`, `deleted` | Filter results by status |
| status.{index} | One of: `unknown_status`, `enabled`, `disabled`, `deleted`, `scheduled_for_deletion` | Filter results by status |
| 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
15 changes: 15 additions & 0 deletions docs/commands/tem.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This API allows you to manage your Transactional Email services.
- [Email statuses](#email-statuses)
- [List emails](#list-emails)
- [Project offers management commands](#project-offers-management-commands)
- [Project consumption management commands](#project-consumption-management-commands)
- [Project settings management commands](#project-settings-management-commands)
- [Webhook management commands](#webhook-management-commands)
- [Create a Webhook](#create-a-webhook)
Expand Down Expand Up @@ -407,6 +408,20 @@ scw tem offers



## Project consumption management commands

Project consumption allow you to see your project consumption.

Project consumption allow you to see your project consumption.

**Usage:**

```
scw tem project-consumption
```



## Project settings management commands

Project settings allow you to manage the configuration of your projects.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,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.32.0.20250218143128-3136832efdcc
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250225092007-04e9c0ceddea
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 @@ -458,8 +458,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.32.0.20250218143128-3136832efdcc h1:YfW5EvR+6f6pGAoAY3Yu2Li4dmLbRxz28S+Nwf+bS+s=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250218143128-3136832efdcc/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250225092007-04e9c0ceddea h1:4QAgjbHe9D9ka0Lw3fpZuFvZ09/CCPmaaFM9eSS7eeM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250225092007-04e9c0ceddea/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func auditTrailEventList() *core.Command {
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"unknown_type", "secm_secret", "secm_secret_version", "kube_cluster", "kube_pool", "kube_node", "kube_acl", "keym_key", "iamx_user", "iamx_application", "iamx_group", "iamx_policy", "iamx_api_key", "iamx_ssh_key"},
EnumValues: []string{"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"},
},
{
Name: "method-name",
Expand Down
7 changes: 7 additions & 0 deletions internal/namespaces/block/v1alpha1/block_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,13 @@ func blockSnapshotList() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "tags.{index}",
Short: `Filter by tags. Only snapshots with one or more matching tags will be returned`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "organization-id",
Short: `Filter by Organization ID`,
Expand Down
9 changes: 8 additions & 1 deletion internal/namespaces/secret/v1beta1/secret_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,13 @@ func secretSecretList() *core.Command {
Positional: false,
EnumValues: []string{"unknown_type", "opaque", "certificate", "key_value", "basic_credentials", "database_credentials", "ssh_key"},
},
{
Name: "scheduled-for-deletion",
Short: `Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional)`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "organization-id",
Short: `Filter by Organization ID (optional)`,
Expand Down Expand Up @@ -752,7 +759,7 @@ func secretVersionList() *core.Command {
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"unknown_status", "enabled", "disabled", "deleted"},
EnumValues: []string{"unknown_status", "enabled", "disabled", "deleted", "scheduled_for_deletion"},
},
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)),
},
Expand Down
10 changes: 10 additions & 0 deletions internal/namespaces/tem/v1alpha1/tem_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func GetGeneratedCommands() *core.Commands {
temProjectSettings(),
temBlocklists(),
temOffers(),
temProjectConsumption(),
temEmailCreate(),
temEmailGet(),
temEmailList(),
Expand Down Expand Up @@ -111,6 +112,15 @@ func temOffers() *core.Command {
}
}

func temProjectConsumption() *core.Command {
return &core.Command{
Short: `Project consumption management commands`,
Long: `Project consumption allow you to see your project consumption.`,
Namespace: "tem",
Resource: "project-consumption",
}
}

func temEmailCreate() *core.Command {
return &core.Command{
Short: `Send an email`,
Expand Down

0 comments on commit 4fbc99c

Please sign in to comment.