Scaleway logo
Commands

Documentation for `scw jobs`

The CLI documentation pages are currently under construction

The content is up to date. We're making improvements to the site over the next few weeks for a better experience.

This API allows you to manage your Serverless Jobs.

Create a new job definition in a specified Project

Create a new job definition in a specified Project.

Usage:

TerminalCode
scw jobs definition create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
nameName of the job definitionRequired
Default: <generated>
cpu-limitCPU limit of the job (in mvCPU)Required
memory-limitMemory limit of the job (in MiB)Required
local-storage-capacityLocal storage capacity of the job (in MiB)Required
image-uriImage to use for the jobRequired
commandStartup command. If empty or not defined, the image's default command is used.Deprecated
startup-command.{index}Job startup command. Overrides the default defined in the job image.
args.{index}Job arguments. Overrides the default arguments defined in the job image.
project-idProject ID to use. If none is passed the default project ID will be used
environment-variables.{key}Environment variables of the job
descriptionDescription of the job
job-timeoutTimeout of the job in seconds
cron-schedule.schedule
cron-schedule.timezone
retry-policy.max-retriesMaximum number of retries upon a job failure.
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Delete an existing job definition by its unique identifier

Delete an existing job definition by its unique identifier.

Usage:

TerminalCode
scw jobs definition delete <job-definition-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-definition-idUUID of the job definition to deleteRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Get a job definition by its unique identifier

Get a job definition by its unique identifier.

Usage:

TerminalCode
scw jobs definition get <job-definition-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-definition-idUUID of the job definition to getRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

List all your job definitions with filters

List all your job definitions with filters.

Usage:

TerminalCode
scw jobs definition list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
order-byOne of: created_at_asc, created_at_desc
project-id
organization-id
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw, all

Run an existing job definition using its unique identifier and create a new job run

Run an existing job definition using its unique identifier and create a new job run.

Usage:

TerminalCode
scw jobs definition start <job-definition-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-definition-idUUID of the job definition to startRequired
commandContextual startup command for this specific job run.Deprecated
startup-command.{index}Contextual startup command for this specific job run.
args.{index}Contextual arguments for this specific job run.
environment-variables.{key}Contextual environment variables for this specific job run
replicasNumber of jobs to run
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Update an existing job definition associated with the specified unique identifier

Update an existing job definition associated with the specified unique identifier.

Usage:

TerminalCode
scw jobs definition update <job-definition-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-definition-idUUID of the job definition to updateRequired
nameName of the job definition
cpu-limitCPU limit of the job (in mvCPU)
memory-limitMemory limit of the job (in MiB)
local-storage-capacityLocal storage capacity of the job (in MiB)
image-uriImage to use for the job
commandStartup command. If empty or not defined, the image's default command is used.Deprecated
startup-command.{index}Job startup command. Overrides the default defined in the job image.
args.{index}Job arguments. Overrides the default arguments defined in the job image.
environment-variables.{key}Environment variables of the job
descriptionDescription of the job
job-timeoutTimeout of the job in seconds
cron-schedule.schedule
cron-schedule.timezone
retry-policy.max-retries
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Get a job run by its unique identifier

Get a job run by its unique identifier.

Usage:

TerminalCode
scw jobs run get <job-run-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-run-idUUID of the job run to getRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

List all job runs with filters

List all job runs with filters.

Usage:

TerminalCode
scw jobs run list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
order-byOne of: created_at_asc, created_at_desc
job-definition-id
project-id
stateOne of: unknown_state, initialized, validated, queued, running, succeeded, failed, interrupting, interrupted, retrying
states.{index}One of: unknown_state, initialized, validated, queued, running, succeeded, failed, interrupting, interrupted, retrying
reasons.{index}One of: unknown_reason, invalid_request, timeout, cancellation, technical_error, image_not_found, invalid_image, memory_usage_exceeded, storage_usage_exceeded, exited_with_error, secret_disabled, secret_not_found, quota_exceeded, application_not_started
organization-id
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw, all

Stop a job run using its unique identifier

Stop a job run using its unique identifier.

Usage:

TerminalCode
scw jobs run stop [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-run-idUUID of the job run to stopRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Wait for a job run to reach a stable state

Wait for a job run to reach a stable state. This is similar to using --wait flag.

Usage:

TerminalCode
scw jobs run wait <job-run-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-run-idRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Create a secret reference within a job definition

Create a secret reference within a job definition.

Usage:

TerminalCode
scw jobs secret create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-definition-idUUID of the job definitionRequired
secrets.{index}.secret-manager-id
secrets.{index}.secret-manager-version
secrets.{index}.path
secrets.{index}.env-var-name
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Delete a secret reference within a job definition

Delete a secret reference within a job definition.

Usage:

TerminalCode
scw jobs secret delete [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
secret-idUUID of the secret reference within the jobRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Get a secret references within a job definition

Get a secret references within a job definition.

Usage:

TerminalCode
scw jobs secret get [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
secret-idUUID of the secret reference within the jobRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

List secrets references within a job definition

List secrets references within a job definition.

Usage:

TerminalCode
scw jobs secret list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-definition-idUUID of the job definitionRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Update a secret reference within a job definition

Update a secret reference within a job definition.

Usage:

TerminalCode
scw jobs secret update [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
secret-idUUID of the secret reference within the jobRequired
secret-manager-versionVersion of the secret in Secret Manager
pathPath of the secret to mount inside the job (either path or env_var_name must be set)
env-var-nameEnvironment variable name used to expose the secret inside the job (either path or env_var_name must be set)
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Create a trigger

Create a trigger.

Usage:

TerminalCode
scw jobs trigger create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-definition-idUUID of the job definitionRequired
nameName of the triggerRequired
cron-config.scheduleCRON schedule in UNIX format
cron-config.timezoneTime zone for the CRON schedule
cron-config.startup-command.{index}Startup command that will be used by the triggered job
cron-config.args.{index}Arguments passed to the startup command used by the triggered job
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Delete a trigger

Delete a trigger.

Usage:

TerminalCode
scw jobs trigger delete [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
trigger-idUUID of the triggerRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

Get a trigger

Get a trigger.

Usage:

TerminalCode
scw jobs trigger get [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
trigger-idUUID of the triggerRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw

List triggers of a job definition

List triggers of a job definition.

Usage:

TerminalCode
scw jobs trigger list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
job-definition-idUUID of the job definitionRequired
order-bySorting order of triggersOne of: created_at_asc, created_at_desc
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw, all

Update a trigger

Update a trigger.

Usage:

TerminalCode
scw jobs trigger update [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
trigger-idUUID of the triggerRequired
nameName of the trigger
cron-config.scheduleCRON schedule in UNIX format
cron-config.timezoneTime zone for the CRON schedule
cron-config.startup-command.{index}Startup command that will be used by the triggered job
cron-config.args.{index}Arguments passed to the startup command used by the triggered job
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams, pl-waw