Skip to content

Latest commit

 

History

History
787 lines (466 loc) · 59.7 KB

File metadata and controls

787 lines (466 loc) · 59.7 KB

Documentation for scw function

Function as a Service API.

Cron management commands

Cron management commands.

Create a new cron

Create a new cronjob for a function with the specified ID.

Usage:

scw function cron create [arg=value ...]

Arguments:

Name Description Argument Specifications
function-id UUID of the function to use the cron with
schedule Schedule of the cron in UNIX cron format
args Arguments to use with the cron
name Name of the cron
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 cron

Delete the cron associated with the specified ID.

Usage:

scw function cron delete <cron-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
cron-id UUID of the cron 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 cron

Get the cron associated with the specified ID.

Usage:

scw function cron get <cron-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
cron-id UUID of the cron 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 crons

List all the cronjobs in a specified region.

Usage:

scw function cron list [arg=value ...]

Arguments:

Name Description Argument Specifications
order-by Order of the crons One of: created_at_asc, created_at_desc
function-id UUID of the function
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 an existing cron

Update the cron associated with the specified ID.

Usage:

scw function cron update <cron-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
cron-id UUID of the cron to update Required
function-id UUID of the function to use the cron with
schedule Schedule of the cron in UNIX cron format
args Arguments to use with the cron
name Name of the cron
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

Deploy a function

Create or fetch, upload and deploy your function

Create or fetch, upload and deploy your function

Usage:

scw function deploy [arg=value ...]

Arguments:

Name Description Argument Specifications
namespace-id Function Namespace ID to deploy to
name Name of the function to deploy, will be used in namespace's name if no ID is provided Required
runtime Required
One of: unknown_runtime, golang, python, python3, node8, node10, node14, node16, node17, python37, python38, python39, python310, go113, go117, go118, node18, rust165, go119, python311, php82, node19, go120, node20, go121, node22, python312, php83, go122, rust179, go123, go124, python313, rust185, php84, node24, node26, go125, go126, php85, python314, rust196
zip-file Path of the zip file that contains your code 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

Domain management commands

Domain management commands.

Create a domain name binding

Create a domain name binding for the function with the specified ID.

Usage:

scw function domain create [arg=value ...]

Arguments:

Name Description Argument Specifications
hostname Hostname to create
function-id UUID of the function to associate the domain with
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 domain name binding

Delete a domain name binding for the function with the specified ID.

Usage:

scw function domain delete <domain-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
domain-id UUID of the domain 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 domain name binding

Get a domain name binding for the function with the specified ID.

Usage:

scw function domain get <domain-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
domain-id UUID of the domain 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 domain name bindings

List all domain name bindings in a specified region.

Usage:

scw function domain list [arg=value ...]

Arguments:

Name Description Argument Specifications
order-by Order of the domains One of: created_at_asc, created_at_desc, hostname_asc, hostname_desc
function-id UUID of the function the domain is associated with
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

Function management commands

Function management commands.

Create a new function

Create a new function in the specified region for a specified Organization or Project.

Usage:

scw function function create [arg=value ...]

Arguments:

Name Description Argument Specifications
name Name of the function to create Default: <generated>
namespace-id UUID of the namespace the function will be created in
environment-variables.{key} Environment variables of the function
min-scale Minimum number of instances to scale the function to
max-scale Maximum number of instances to scale the function to
runtime Runtime to use with the function One of: unknown_runtime, golang, python, python3, node8, node10, node14, node16, node17, python37, python38, python39, python310, go113, go117, go118, node18, rust165, go119, python311, php82, node19, go120, node20, go121, node22, python312, php83, go122, rust179, go123, go124, python313, rust185, php84, node24, node26, go125, go126, php85, python314, rust196
memory-limit Memory limit of the function in MB
timeout Request processing time limit for the function
handler Handler to use with the function
privacy Privacy setting of the function One of: unknown_privacy, public, private
description Description of the function
secret-environment-variables.{index}.key
secret-environment-variables.{index}.value
http-option Configure how HTTP and HTTPS requests are handled Default: enabled
One of: unknown_http_option, enabled, redirected
sandbox Execution environment of the function One of: unknown_sandbox, v1, v2
tags.{index} Tags of the Serverless Function
private-network-id ID of the Private Network the function is connected to.
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 function

Delete the function associated with the specified ID.

Usage:

scw function function delete <function-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
function-id UUID of the function 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

Deploy a function

Deploy a function associated with the specified ID.

Usage:

scw function function deploy <function-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
function-id UUID of the function to deploy 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 function

Get the function associated with the specified ID.

Usage:

scw function function get <function-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
function-id UUID of the function 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 download URL of a function

Get a download URL for a function associated with the specified ID.

Usage:

scw function function get-download-url <function-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
function-id UUID of the function to get the download URL for 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 an upload URL of a function

Get an upload URL of a function associated with the specified ID.

Usage:

scw function function get-upload-url <function-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
function-id UUID of the function to get the upload URL for Required
content-length Size of the archive to upload in bytes 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 functions

List all your functions.

Usage:

scw function function list [arg=value ...]

Arguments:

Name Description Argument Specifications
order-by Order of the functions One of: created_at_asc, created_at_desc, name_asc, name_desc
namespace-id UUID of the namespace the function belongs to
name Name of the function
project-id UUID of the Project the function belongs to
organization-id UUID of the Organization the function belongs to
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 an existing function

Update the function associated with the specified ID.

When updating a function, the function is automatically redeployed to apply the changes. This behavior can be changed by setting the redeploy field to false in the request.

Usage:

scw function function update <function-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
function-id UUID of the function to update Required
environment-variables.{key} Environment variables of the function to update
min-scale Minimum number of instances to scale the function to
max-scale Maximum number of instances to scale the function to
runtime Runtime to use with the function One of: unknown_runtime, golang, python, python3, node8, node10, node14, node16, node17, python37, python38, python39, python310, go113, go117, go118, node18, rust165, go119, python311, php82, node19, go120, node20, go121, node22, python312, php83, go122, rust179, go123, go124, python313, rust185, php84, node24, node26, go125, go126, php85, python314, rust196
memory-limit Memory limit of the function in MB
timeout Processing time limit for the function
redeploy Redeploy failed function
handler Handler to use with the function
privacy Privacy setting of the function One of: unknown_privacy, public, private
description Description of the function
secret-environment-variables.{index}.key
secret-environment-variables.{index}.value
http-option Configure how HTTP and HTTPS requests are handled One of: unknown_http_option, enabled, redirected
sandbox Execution environment of the function One of: unknown_sandbox, v1, v2
tags.{index} Tags of the Serverless Function
private-network-id ID of the Private Network the function is connected to.
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

Function namespace management commands

Function namespace management commands.

Create a new namespace

Create a new namespace in a specified Organization or Project.

Usage:

scw function namespace create [arg=value ...]

Arguments:

Name Description Argument Specifications
name Default: <generated>
environment-variables.{key} Environment variables of the namespace
project-id Project ID to use. If none is passed the default project ID will be used
description Description of the namespace
secret-environment-variables.{index}.key
secret-environment-variables.{index}.value
tags.{index} Tags of the Serverless Function Namespace
activate-vpc-integration [DEPRECATED] By default, as of 2025/08/20, all namespaces are now compatible with VPC. Deprecated
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 namespace

Delete the namespace associated with the specified ID.

Usage:

scw function namespace delete <namespace-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
namespace-id UUID of the namespace 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 namespace

Get the namespace associated with the specified ID.

Usage:

scw function namespace get <namespace-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
namespace-id UUID of the namespace 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 namespaces

List all existing namespaces in the specified region.

Usage:

scw function namespace list [arg=value ...]

Arguments:

Name Description Argument Specifications
order-by Order of the namespaces One of: created_at_asc, created_at_desc, name_asc, name_desc
name Name of the namespace
project-id UUID of the Project the namespace belongs to
organization-id UUID of the Organization the namespace belongs to
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 an existing namespace

Update the namespace associated with the specified ID.

Usage:

scw function namespace update <namespace-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
namespace-id UUID of the namespapce Required
environment-variables.{key} Environment variables of the namespace
description Description of the namespace
secret-environment-variables.{index}.key
secret-environment-variables.{index}.value
tags.{index} Tags of the Serverless Function Namespace
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

Runtime management commands

Runtime management commands.

List function runtimes

List available function runtimes.

Usage:

scw function runtime list [arg=value ...]

Arguments:

Name Description Argument Specifications
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

Token management commands

Token management commands.

Create a new revocable token

Deprecated in favor of IAM authentication.

Usage:

scw function token create [arg=value ...]

Arguments:

Name Description Argument Specifications
function-id UUID of the function to associate the token with
namespace-id UUID of the namespace to associate the token with
description Description of the token
expires-at Date on which the token expires
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 token

Delete a token.

Usage:

scw function token delete <token-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
token-id UUID of the token 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 token

Get a token.

Usage:

scw function token get <token-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
token-id UUID of the token 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 tokens

List all tokens.

Usage:

scw function token list [arg=value ...]

Arguments:

Name Description Argument Specifications
order-by Sort order for the tokens One of: created_at_asc, created_at_desc
function-id UUID of the function the token is associated with
namespace-id UUID of the namespace the token is associated with
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

Trigger management commands

Trigger management commands.

Create a trigger

Create a new trigger for a specified function.

Usage:

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

Arguments:

Name Description Argument Specifications
name Name of the trigger Required
function-id ID of the function to trigger Required
description Description of the trigger
scw-sqs-config.queue Name of the SQS queue the trigger should listen to
scw-sqs-config.mnq-project-id ID of the Messaging and Queuing project
scw-sqs-config.mnq-region Region in which the Messaging and Queuing project is activated.
scw-nats-config.subject Name of the NATS subject the trigger should listen to
scw-nats-config.mnq-nats-account-id ID of the Messaging and Queuing NATS account
scw-nats-config.mnq-project-id ID of the Messaging and Queuing project
scw-nats-config.mnq-region Region in which the Messaging and Queuing project is activated.
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 with a specified ID.

Usage:

scw function trigger delete <trigger-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
trigger-id ID of the trigger 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 trigger

Get a trigger with a specified ID.

Usage:

scw function trigger get <trigger-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
trigger-id ID of the trigger 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 triggers

List all triggers belonging to a specified Organization or Project.

Usage:

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

Arguments:

Name Description Argument Specifications
order-by Order in which to return results One of: created_at_asc, created_at_desc
function-id ID of the function the triggers belongs to
namespace-id ID of the namespace the triggers belongs to
project-id Project ID to use. If none is passed the default project ID will be used
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 with a specified ID.

Usage:

scw function trigger update <trigger-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
trigger-id ID of the trigger to update Required
name Name of the trigger
description Description of the trigger
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