Skip to content

Commit 8e9e487

Browse files
feat(serverless): add CronSchedule to job definitions (#3568)
Co-authored-by: Rémy Léone <[email protected]>
1 parent f780a52 commit 8e9e487

13 files changed

+161
-107
lines changed

cmd/scw/testdata/test-all-usage-jobs-definition-create-usage.golden

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Create jobs resources.
3+
Create a new job definition in a specified Project.
44

55
USAGE:
66
scw jobs definition create [arg=value ...]
77

88
ARGS:
9-
name=<generated>
10-
cpu-limit
11-
memory-limit
12-
[image-uri]
13-
[command]
9+
name=<generated> Name of the job definition
10+
cpu-limit CPU limit of the job
11+
memory-limit Memory limit of the job
12+
[image-uri] Image to use for the job
13+
[command] Startup command
1414
[project-id] Project ID to use. If none is passed the default project ID will be used
15-
[environment-variables.{key}]
16-
[description]
17-
[job-timeout]
15+
[environment-variables.{key}] Environment variables of the job
16+
[description] Description of the job
17+
[job-timeout] Timeout of the job in seconds
18+
[cron-schedule.schedule]
19+
[cron-schedule.timezone]
1820
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1921

2022
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-definition-delete-usage.golden

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Delete jobs resources.
3+
Delete an exsisting job definition by its unique identifier.
44

55
USAGE:
66
scw jobs definition delete <job-definition-id ...> [arg=value ...]
77

88
ARGS:
9-
job-definition-id
9+
job-definition-id UUID of the job definition to delete
1010
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1111

1212
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-definition-get-usage.golden

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Get jobs resources.
3+
Get a job definition by its unique identifier.
44

55
USAGE:
66
scw jobs definition get <job-definition-id ...> [arg=value ...]
77

88
ARGS:
9-
job-definition-id
9+
job-definition-id UUID of the job definition to get
1010
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1111

1212
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-definition-list-usage.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
List jobs resources.
3+
List all your job definitions with filters.
44

55
USAGE:
66
scw jobs definition list [arg=value ...]

cmd/scw/testdata/test-all-usage-jobs-definition-start-usage.golden

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Start jobs resources.
3+
Run an existing job definition by its unique identifier. This will create a new job run.
44

55
USAGE:
66
scw jobs definition start <job-definition-id ...> [arg=value ...]
77

88
ARGS:
9-
job-definition-id
9+
job-definition-id UUID of the job definition to start
1010
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1111

1212
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-definition-update-usage.golden

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Update jobs resources.
3+
Update an existing job definition associated with the specified unique identifier.
44

55
USAGE:
66
scw jobs definition update <job-definition-id ...> [arg=value ...]
77

88
ARGS:
9-
job-definition-id
10-
[name]
11-
[cpu-limit]
12-
[memory-limit]
13-
[image-uri]
14-
[command]
15-
[environment-variables.{key}]
16-
[description]
17-
[job-timeout]
9+
job-definition-id UUID of the job definition to update
10+
[name] Name of the job definition
11+
[cpu-limit] CPU limit of the job
12+
[memory-limit] Memory limit of the job
13+
[image-uri] Image to use for the job
14+
[command] Startup command
15+
[environment-variables.{key}] Environment variables of the job
16+
[description] Description of the job
17+
[job-timeout] Timeout of the job in seconds
18+
[cron-schedule.schedule]
19+
[cron-schedule.timezone]
1820
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1921

2022
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-definition-usage.golden

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ USAGE:
44
scw jobs definition <command>
55

66
AVAILABLE COMMANDS:
7-
create Create jobs resources
8-
delete Delete jobs resources
9-
get Get jobs resources
10-
list List jobs resources
11-
start Start jobs resources
12-
update Update jobs resources
7+
create Create a new job definition in a specified Project
8+
delete Delete an exsisting job definition by its unique identifier
9+
get Get a job definition by its unique identifier
10+
list List all your job definitions with filters
11+
start Run an existing job definition by its unique identifier. This will create a new job run
12+
update Update an existing job definition associated with the specified unique identifier
1313

1414
FLAGS:
1515
-h, --help help for definition

cmd/scw/testdata/test-all-usage-jobs-run-get-usage.golden

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Get jobs resources.
3+
Get a job run by its unique identifier.
44

55
USAGE:
66
scw jobs run get <job-run-id ...> [arg=value ...]
77

88
ARGS:
9-
job-run-id
9+
job-run-id UUID of the job run to get
1010
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1111

1212
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-run-list-usage.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
List jobs resources.
3+
List all job runs with filters.
44

55
USAGE:
66
scw jobs run list [arg=value ...]

cmd/scw/testdata/test-all-usage-jobs-run-stop-usage.golden

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Stop jobs resources.
3+
Stop a job run by its unique identifier.
44

55
USAGE:
66
scw jobs run stop <job-run-id ...> [arg=value ...]
77

88
ARGS:
9-
job-run-id
9+
job-run-id UUID of the job run to stop
1010
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1111

1212
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-run-usage.golden

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ USAGE:
44
scw jobs run <command>
55

66
AVAILABLE COMMANDS:
7-
get Get jobs resources
8-
list List jobs resources
9-
stop Stop jobs resources
7+
get Get a job run by its unique identifier
8+
list List all job runs with filters
9+
stop Stop a job run by its unique identifier
1010
wait Wait for a job run to reach a stable state
1111

1212
FLAGS:

0 commit comments

Comments
 (0)