Documentation for `scw container`
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 Containers.
Container management commands
Container management commands.
Create a new container in a namespace.
Name must be unique inside the given namespace.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| namespace-id | Unique ID of the namespace the container belongs to. | Required |
| name | Container name. | Required |
| environment-variables.{key} | Environment variables of the container. | |
| secret-environment-variables.{key} | Secret environment variables of the container. | |
| min-scale | Minimum number of instances to scale the container to. | |
| max-scale | Maximum number of instances to scale the container to. | |
| memory-limit-bytes | Memory limit of the container in bytes. | |
| mvcpu-limit | CPU limit of the container in mvCPU. | |
| timeout | Processing time limit for the container. | |
| privacy | Privacy policy of the container. | Default: publicOne of: unknown_privacy, public, private |
| description | Container description. | |
| image | Image reference (e.g. "rg.fr-par.scw.cloud/my-registry-namespace/image | Required |
| protocol | Protocol the container uses. | Default: http1One of: unknown_protocol, http1, h2c |
| port | Port the container listens on. | Default: 8080 |
| https-connections-only | If true, it will allow only HTTPS connections to access your container to prevent it from being triggered by insecure connections (HTTP). | Default: false |
| sandbox | Execution environment of the container. | Default: v2One of: unknown_sandbox, v1, v2 |
| local-storage-limit-bytes | Local storage limit of the container (in bytes). | |
| scaling-option.concurrent-requests-threshold | Scale depending on the number of concurrent requests being processed per container instance. The threshold value is the number of concurrent requests above which the container will be scaled up. | |
| scaling-option.cpu-usage-threshold | Scale depending on the CPU usage of a container instance. The threshold value is the percentage of CPU usage above which the container will be scaled up. | |
| scaling-option.memory-usage-threshold | Scale depending on the memory usage of a container instance. The threshold value is the percentage of memory usage above which the container will be scaled up. | |
| liveness-probe.failure-threshold | Number of consecutive failures before considering the container as unhealthy | |
| liveness-probe.interval | Time interval between checks. | |
| liveness-probe.timeout | Duration before the check times out. | |
| liveness-probe.tcp | Perform TCP check on the container. | |
| liveness-probe.http.path | HTTP path to perform the check on. | |
| startup-probe.failure-threshold | Number of consecutive failures before considering the container as unhealthy | |
| startup-probe.interval | Time interval between checks. | |
| startup-probe.timeout | Duration before the check times out. | |
| startup-probe.tcp | Perform TCP check on the container. | |
| startup-probe.http.path | HTTP path to perform the check on. | |
| tags.{index} | Tags of the Serverless Container. | |
| private-network-id | ID of the Private Network the container is connected to. | |
| command.{index} | Container command | |
| args.{index} | Container arguments | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Delete the container associated with the specified ID.
It also deletes in cascade any resource linked to the container (crons, tokens, etc.).
This action cannot be undone.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| container-id | UUID of the container to delete. | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Get the container associated with the specified ID.
Get the container associated with the specified ID.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| container-id | UUID of the container to get | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
List all containers the caller can access (read permission).
By default, the containers listed are ordered by creation date in ascending order. This can be modified via the order_by field.
Additional parameters can be set in the query to filter, such as organization_id, project_id, and name.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| order-by | One of: created_at_asc, created_at_desc, name_asc, name_desc | |
| project-id | ||
| namespace-id | ||
| name | ||
| organization-id | ||
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw, all |
Show container logs
Display the logs of a container from the last 2 hours
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| container-id | ID of the container which logs are to be displayed | |
| time-span | Time range for which to retrieve container logs in duration format, defaults to 2h | Default: 2h |
| entry-count | Maximum number of log entries to be displayed | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Redeploy a container
Performs a rollout of the container by creating new instances with the latest image version and terminating the old instances.
When using mutable registry image references (e.g. my-registry-namespace/image:tag), this endpoint can be used to force the container to use
the most recent image version available in the registry.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| container-id | ID of the container to redeploy. | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Update the container associated with the specified ID.
Only fields present in the request are updated; others are left untouched.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| container-id | UUID of the container to update. | Required |
| environment-variables.{key} | Environment variables of the container. | |
| secret-environment-variables.{key} | Secret environment variables of the container. | |
| min-scale | Minimum number of instances to scale the container to. | |
| max-scale | Maximum number of instances to scale the container to. | |
| memory-limit-bytes | Memory limit of the container in bytes. | |
| mvcpu-limit | CPU limit of the container in mvCPU. | |
| timeout | Processing time limit for the container. | |
| privacy | Privacy policy of the container. | One of: unknown_privacy, public, private |
| description | Container description. | |
| image | Image reference (e.g. "rg.fr-par.scw.cloud/my-registry-namespace/image | |
| protocol | Protocol the container uses. | One of: unknown_protocol, http1, h2c |
| port | Port the container listens on. | |
| https-connection-only | If true, it will allow only HTTPS connections to access your container to prevent it from being triggered by insecure connections (HTTP). | |
| sandbox | Execution environment of the container. | One of: unknown_sandbox, v1, v2 |
| local-storage-limit-bytes | Local storage limit of the container (in bytes). | |
| scaling-option.concurrent-requests-threshold | Scale depending on the number of concurrent requests being processed per container instance. The threshold value is the number of concurrent requests above which the container will be scaled up. | |
| scaling-option.cpu-usage-threshold | Scale depending on the CPU usage of a container instance. The threshold value is the percentage of CPU usage above which the container will be scaled up. | |
| scaling-option.memory-usage-threshold | Scale depending on the memory usage of a container instance. The threshold value is the percentage of memory usage above which the container will be scaled up. | |
| liveness-probe.failure-threshold | Number of consecutive failures before considering the container as unhealthy | |
| liveness-probe.interval | Time interval between checks. | |
| liveness-probe.timeout | Duration before the check times out. | |
| liveness-probe.tcp | Perform TCP check on the container. | |
| liveness-probe.http.path | HTTP path to perform the check on. | |
| startup-probe.failure-threshold | ||
| startup-probe.interval | ||
| startup-probe.timeout | ||
| startup-probe.http.path | ||
| startup-probe.tcp | ||
| tags.{index} | Tags of the Serverless Container. | |
| private-network-id | ID of the Private Network the container is connected to. | |
| command.{index} | Container command | |
| args.{index} | Container arguments | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Deploy a container
Automatically build and deploy a container.
Automatically build and deploy a container.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| name | Name of the application (defaults to build-source's directory name) | |
| builder | Builder image to use | Default: paketobuildpacks/builder-jammy-base:latest |
| run-image | Run image to use | Default: paketobuildpacks/run-jammy-base:latest |
| dockerfile | Path to the Dockerfile | Default: Dockerfile |
| force-builder | Force the use of the builder image (even if a Dockerfile is present) | Default: false |
| build-source | Path to the build context | Default: . |
| cache | Use cache when building the image | Default: true |
| build-args.{key} | Build-time variables | |
| platform | Target platform to build for (e.g. linux/amd64, linux/arm64) | |
| port | Port to expose | Default: 8080 |
| namespace-id | Container Namespace ID to deploy to | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw, all |
Domain management commands
Domain management commands.
Create a new custom domain for the container with the specified ID.
Create a new custom domain for the container with the specified ID.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| container-id | Unique ID of the container the domain will be assigned to. | Required |
| hostname | Domain assigned to the container. | Required |
| tags.{index} | A list of arbitrary tags associated with the domain. | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Delete the custom domain associated with the specified ID.
Delete the custom domain associated with the specified ID.
Usage:
Code
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-parOne of: fr-par, nl-ams, pl-waw |
Get the custom domain associated with the specified ID.
Get the custom domain associated with the specified ID.
Usage:
Code
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-parOne of: fr-par, nl-ams, pl-waw |
List all custom domains the caller can access (read permission).
By default, the custom domains listed are ordered by creation date in ascending order. This can be modified via the order_by field.
Additional parameters can be set in the query to filter the output, such as organization_id, project_id, namespace_id, or container_id.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| order-by | One of: created_at_asc, created_at_desc, hostname_asc, hostname_desc | |
| project-id | ||
| namespace-id | ||
| container-id | ||
| organization-id | ||
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw, all |
Update the domain associated with the specified ID.
Only fields present in the request are updated; others are left untouched.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| domain-id | UUID of the domain to update. | Required |
| tags.{index} | A list of arbitrary tags associated with the domain. | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Namespace management commands
Namespace management commands.
Create a new namespace.
Namespace name must be unique inside a project.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| project-id | Project ID to use. If none is passed the default project ID will be used | |
| name | Namespace name. | Required |
| description | Namespace description. | |
| environment-variables.{key} | Namespace environment variables. | |
| secret-environment-variables.{key} | Namespace secret environment variables. | |
| tags.{index} | A list of arbitrary tags associated with the namespace. | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Delete the namespace associated with the specified ID.
It also deletes in cascade any resource inside the namespace.
This action cannot be undone.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| namespace-id | UUID of the namespace to delete. | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Get the namespace associated with the specified ID.
Get the namespace associated with the specified ID.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| namespace-id | UUID of the namespace to get | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
List all namespaces the caller can access (read permission).
By default, the namespaces listed are ordered by creation date in ascending order. This can be modified via the order_by field.
Additional parameters can be set in the query to filter, such as organization_id, project_id, and name.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| order-by | One of: created_at_asc, created_at_desc, name_asc, name_desc | |
| project-id | ||
| name | ||
| organization-id | ||
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw, all |
Update the namespace associated with the specified ID.
Only fields present in the request are updated; others are left untouched.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| namespace-id | UUID of the namespace to update. | Required |
| description | Namespace description. | |
| environment-variables.{key} | Namespace environment variables. | |
| secret-environment-variables.{key} | Namespace secret environment variables. | |
| tags.{index} | A list of arbitrary tags associated with the namespace. | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne 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:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| container-id | UUID of the container to create the token for | |
| namespace-id | UUID of the namespace to create the token for | |
| description | Description of the token | |
| expires-at | Expiry date of the token | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Delete a token
Delete a token with a specified ID.
Usage:
Code
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-parOne of: fr-par, nl-ams, pl-waw |
Get a token
Get a token with a specified ID.
Usage:
Code
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-parOne of: fr-par, nl-ams, pl-waw |
List all tokens
List all tokens belonging to a specified Organization or Project.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| order-by | Order of the tokens | One of: created_at_asc, created_at_desc |
| container-id | UUID of the container the token belongs to | |
| namespace-id | UUID of the namespace the token belongs to | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw, all |
Trigger management commands
Trigger management commands.
Create a new trigger for the container with the specified ID.
Create a new trigger for the container with the specified ID.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| container-id | ID of the container to trigger. | Required |
| name | Name of the trigger. | Required |
| description | Description of the trigger. | |
| tags.{index} | Tags of the trigger. | |
| destination-config.http-path | The HTTP path to send the request to (e.g., "/my-webhook-endpoint"). | |
| destination-config.http-method | The HTTP method to use when sending the request (e.g., get, post, put, patch, delete). Must be specified as lowercase. | One of: unknown_http_method, get, post, put, patch, delete |
| cron-config.schedule | UNIX cron schedule to run job (e.g., "* * * * *"). | |
| cron-config.timezone | Timezone for the cron schedule, in tz database format (e.g., "Europe/Paris"). | |
| cron-config.body | Body to send to the container when the trigger is invoked. | |
| cron-config.headers.{key} | Additional headers to send to the container when the trigger is invoked. | |
| sqs-config.region | The region where the SQS queue is hosted (e.g., "fr-par", "nl-ams"). | |
| sqs-config.endpoint | Endpoint URL to use to access SQS (e.g., "https://sqs.mnq.fr-par.scaleway.comOpen in new context"). | |
| sqs-config.access-key-id | The access key for accessing the SQS queue. | |
| sqs-config.secret-access-key | The secret key for accessing the SQS queue. | |
| sqs-config.queue-url | The URL of the SQS queue to monitor for messages. | |
| nats-config.server-urls.{index} | The URLs of the NATS server (e.g., "nats://nats.mnq.fr-par.scaleway.com:4222"). | |
| nats-config.subject | NATS subject to subscribe to (e.g., "my-subject"). | |
| nats-config.credentials-file-content | The content of the NATS credentials file. | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |
Delete the trigger associated with the specified ID.
This action cannot be undone.
Usage:
Code
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-parOne of: fr-par, nl-ams, pl-waw |
Get the trigger associated with the specified ID.
Get the trigger associated with the specified ID.
Usage:
Code
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-parOne of: fr-par, nl-ams, pl-waw |
List all triggers the caller can access (read permission).
By default, the triggers listed are ordered by creation date in ascending order. This can be modified via the order_by field.
Additional parameters can be set in the query to filter, such as organization_id, project_id, namespace_id, container_id or trigger_type.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| order-by | One of: created_at_asc, created_at_desc, name_asc, name_desc | |
| project-id | ||
| namespace-id | ||
| container-id | ||
| trigger-type | One of: unknown_source_type, cron, sqs, nats | |
| organization-id | ||
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw, all |
Update the trigger associated with the specified ID.
When updating a trigger, you cannot specify a different source type than the one already set. Only fields present in the request are updated; others are left untouched.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| trigger-id | ID of the trigger to update. | Required |
| name | Name of the trigger. | |
| description | Description of the trigger. | |
| tags.{index} | Tags of the trigger. | |
| destination-config.http-path | The HTTP path to send the request to (e.g., "/my-webhook-endpoint"). | |
| destination-config.http-method | The HTTP method to use when sending the request (e.g., get, post, put, patch, delete). Must be specified as lowercase. | One of: unknown_http_method, get, post, put, patch, delete |
| cron-config.schedule | UNIX cron schedule to run job (e.g., "* * * * *"). | |
| cron-config.timezone | Timezone for the cron schedule, in tz database format (e.g., "Europe/Paris"). | |
| cron-config.body | Body to send to the container when the trigger is invoked. | |
| cron-config.headers.{key} | Additional headers to send to the container when the trigger is invoked. | |
| sqs-config.region | The region where the SQS queue is hosted (e.g., "fr-par", "nl-ams"). | |
| sqs-config.endpoint | Endpoint URL to use to access SQS (e.g., "https://sqs.mnq.fr-par.scaleway.comOpen in new context"). | |
| sqs-config.access-key-id | The access key for accessing the SQS queue. | |
| sqs-config.secret-access-key | The secret key for accessing the SQS queue. | |
| sqs-config.queue-url | The URL of the SQS queue to monitor for messages. | |
| nats-config.server-urls.{index} | The URLs of the NATS server (e.g., "nats://nats.mnq.fr-par.scaleway.com:4222"). | |
| nats-config.subject | NATS subject to subscribe to (e.g., "my-subject"). | |
| nats-config.credentials-file-content | The content of the NATS credentials file. | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams, pl-waw |