Skip to content

Latest commit

 

History

History
483 lines (286 loc) · 29.2 KB

jobs.md

File metadata and controls

483 lines (286 loc) · 29.2 KB

Documentation for scw jobs

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:

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

Arguments:

Name Description Argument Specifications
name Name of the job definition Required
Default: <generated>
cpu-limit CPU limit of the job (in mvCPU) Required
memory-limit Memory limit of the job (in MiB) Required
local-storage-capacity Local storage capacity of the job (in MiB) Required
image-uri Image to use for the job Required
command Startup 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-id Project ID to use. If none is passed the default project ID will be used
environment-variables.{key} Environment variables of the job
description Description of the job
job-timeout Timeout of the job in seconds
cron-schedule.schedule
cron-schedule.timezone
retry-policy.max-retries Maximum number of retries upon a job failure.
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-definition-id UUID of the job definition to delete Required
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-definition-id UUID of the job definition to get Required
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
order-by One of: created_at_asc, created_at_desc
project-id
organization-id
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-definition-id UUID of the job definition to start Required
command Contextual 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
replicas Number of jobs to run
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-definition-id UUID of the job definition to update Required
name Name of the job definition
cpu-limit CPU limit of the job (in mvCPU)
memory-limit Memory limit of the job (in MiB)
local-storage-capacity Local storage capacity of the job (in MiB)
image-uri Image to use for the job
command Startup 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
description Description of the job
job-timeout Timeout of the job in seconds
cron-schedule.schedule
cron-schedule.timezone
retry-policy.max-retries
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-run-id UUID of the job run to get Required
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, nl-ams, pl-waw

List all job runs with filters

List all job runs with filters.

Usage:

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

Arguments:

Name Description Argument Specifications
order-by One of: created_at_asc, created_at_desc
job-definition-id
project-id
state One 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
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-run-id UUID of the job run to stop Required
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-run-id Required
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-definition-id UUID of the job definition Required
secrets.{index}.secret-manager-id
secrets.{index}.secret-manager-version
secrets.{index}.path
secrets.{index}.env-var-name
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
secret-id UUID of the secret reference within the job Required
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
secret-id UUID of the secret reference within the job Required
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
job-definition-id UUID of the job definition Required
region Region to target. If none is passed will use default region from the config Default: 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:

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

Arguments:

Name Description Argument Specifications
secret-id UUID of the secret reference within the job Required
secret-manager-version Version of the secret in Secret Manager
path Path of the secret to mount inside the job (either path or env_var_name must be set)
env-var-name Environment variable name used to expose the secret inside the job (either path or env_var_name must be set)
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, nl-ams, pl-waw

Create a trigger

Create a trigger.

Usage:

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

Arguments:

Name Description Argument Specifications
job-definition-id UUID of the job definition Required
name Name of the trigger Required
cron-config.schedule CRON schedule in UNIX format
cron-config.timezone Time 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
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, nl-ams, pl-waw

Delete a trigger

Delete a trigger.

Usage:

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

Arguments:

Name Description Argument Specifications
trigger-id UUID of the trigger Required
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, nl-ams, pl-waw

Get a trigger

Get a trigger.

Usage:

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

Arguments:

Name Description Argument Specifications
trigger-id UUID of the trigger Required
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, nl-ams, pl-waw

List triggers of a job definition

List triggers of a job definition.

Usage:

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

Arguments:

Name Description Argument Specifications
job-definition-id UUID of the job definition Required
order-by Sorting order of triggers One of: created_at_asc, created_at_desc
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, nl-ams, pl-waw, all

Update a trigger

Update a trigger.

Usage:

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

Arguments:

Name Description Argument Specifications
trigger-id UUID of the trigger Required
name Name of the trigger
cron-config.schedule CRON schedule in UNIX format
cron-config.timezone Time 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
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, nl-ams, pl-waw