From 7827fc5049e7b2f36b3658f149e097fcdadfd65f Mon Sep 17 00:00:00 2001 From: Scaleway Bot Date: Fri, 17 Jan 2025 16:02:53 +0100 Subject: [PATCH] feat(serverless_jobs): add state filter to list job runs (#4440) --- cmd/scw/testdata/test-all-usage-jobs-run-list-usage.golden | 1 + docs/commands/jobs.md | 1 + internal/namespaces/jobs/v1alpha1/jobs_cli.go | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/cmd/scw/testdata/test-all-usage-jobs-run-list-usage.golden b/cmd/scw/testdata/test-all-usage-jobs-run-list-usage.golden index 08c0c7f430..1db2f96d7f 100644 --- a/cmd/scw/testdata/test-all-usage-jobs-run-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-jobs-run-list-usage.golden @@ -9,6 +9,7 @@ ARGS: [order-by] (created_at_asc | created_at_desc) [job-definition-id] [project-id] + [state] (unknown_state | queued | scheduled | running | succeeded | failed | canceled | internal_error) [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) diff --git a/docs/commands/jobs.md b/docs/commands/jobs.md index 77185571c0..c50066c95f 100644 --- a/docs/commands/jobs.md +++ b/docs/commands/jobs.md @@ -217,6 +217,7 @@ scw jobs run list [arg=value ...] | order-by | One of: `created_at_asc`, `created_at_desc` | | | job-definition-id | | | | project-id | | | +| state | One of: `unknown_state`, `queued`, `scheduled`, `running`, `succeeded`, `failed`, `canceled`, `internal_error` | | | organization-id | | | | region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | diff --git a/internal/namespaces/jobs/v1alpha1/jobs_cli.go b/internal/namespaces/jobs/v1alpha1/jobs_cli.go index 6b06c6e957..bdd47a52a7 100644 --- a/internal/namespaces/jobs/v1alpha1/jobs_cli.go +++ b/internal/namespaces/jobs/v1alpha1/jobs_cli.go @@ -758,6 +758,13 @@ func jobsRunList() *core.Command { Deprecated: false, Positional: false, }, + { + Name: "state", + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"unknown_state", "queued", "scheduled", "running", "succeeded", "failed", "canceled", "internal_error"}, + }, { Name: "organization-id", Required: false,