Skip to content

Latest commit

 

History

History
379 lines (229 loc) · 10.8 KB

jobs.md

File metadata and controls

379 lines (229 loc) · 10.8 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 ...]

Args:

Name Description
name Required
Default: <generated>
Name of the job definition
cpu-limit Required CPU limit of the job
memory-limit Required Memory limit of the job (in MiB)
local-storage-capacity Local storage capacity of the job (in MiB)
image-uri Required Image to use for the job
command Startup command. If empty or not defined, the image's default command is used.
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
region Default: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Delete an exsisting job definition by its unique identifier

Delete an exsisting job definition by its unique identifier.

Usage:

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

Args:

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

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 ...]

Args:

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

List all your job definitions with filters

List all your job definitions with filters.

Usage:

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

Args:

Name Description
order-by One of: created_at_asc, created_at_desc
project-id
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

Run an existing job definition by its unique identifier. This will create a new job run

Run an existing job definition by its unique identifier. This will create a new job run.

Usage:

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

Args:

Name Description
job-definition-id Required UUID of the job definition to start
command Contextual startup command for this specific job run
environment-variables.{key} Contextual environment variables for this specific job run
replicas Number of jobs to run
region Default: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

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 ...]

Args:

Name Description
job-definition-id Required UUID of the job definition to update
name Name of the job definition
cpu-limit CPU limit of the job
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
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
region Default: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

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 ...]

Args:

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

List all job runs with filters

List all job runs with filters.

Usage:

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

Args:

Name Description
order-by One of: created_at_asc, created_at_desc
job-definition-id
project-id
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

Stop a job run by its unique identifier

Stop a job run by its unique identifier.

Usage:

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

Args:

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

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 ...]

Args:

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

Create a secret reference within a job definition

Create a secret reference within a job definition.

Usage:

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

Args:

Name Description
job-definition-id Required UUID of the job definition
secrets.{index}.secret-manager-id
secrets.{index}.secret-manager-version
secrets.{index}.path
secrets.{index}.env-var-name
region Default: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Delete a secret reference within a job definition

Delete a secret reference within a job definition.

Usage:

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

Args:

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

Get a secret references within a job definition

Get a secret references within a job definition.

Usage:

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

Args:

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

List secrets references within a job definition

List secrets references within a job definition.

Usage:

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

Args:

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

Update a secret reference within a job definition

Update a secret reference within a job definition.

Usage:

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

Args:

Name Description
job-definition-id Required UUID of the job definition
secret-id Required UUID of the secret reference within the job
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 Default: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config