API V1
  • Global information
  • Authentication
  • Data format
  • Rate Limit
  • Errors
  • Pagination
RESOURCES
  • Addon providers
  • Addons
  • Alerts
  • Applications
  • Audit Logs
  • Autoscalers
  • Billing
  • Collaborators
  • Container Sizes
  • Cron Tasks
  • Data Access Consents
  • Databases
  • Deployment
  • Domains
  • Environment variables
  • Event Categories
  • Event Types
  • Events
  • Invoices
  • SSH Keys
  • Log Drains
  • Application Logs
  • Metrics
  • Notification Platforms
  • Notifiers
  • One-off Containers
    • Access your container
    • Update your container
    • Upload a file to your container
  • Operations
  • Projects
  • Referral
  • Regions
  • SCM Integrations
  • Integration Link
  • Sources
  • Stacks
  • Tokens
  • User Account
LINKS
  • Addon Provider API
  • Database API
  • One-click Deployment API
  • scalingo.json Schema
  • Main site
  • Dashboard

One-off Containers

When you request to one-off container, you will receive an operation and an operation_url. This page explains how to use this endpoint.

Access your container

To access your container, you need to poll the operation_url. The response will include the status of the operation. When the status is done, an attach_url attribute will be provided, which you can use to attach to the container.

Example:

curl -H 'Content-Type: application/json' -H 'Accept: application/json' \
  [:operation_url]

Once the operation status is done, use the attach_url to connect to the container.

Update your container

PUT [:attach_url]

Send information to the container to update its state. As containers are interactive and that most software you may be using are using libreadline, your should notify the container when the size of the terminal is changed for instance.

Parameters

  • width: Width for the remote terminal
  • height: Height for the remote terminal

Example request:

curl -H 'Content-Type: application/json' -H 'Accept: application/json' \
  -X PUT [:attach_url] -d \
  '{
    "width": 80,
    "height": 25
  }'

Upload a file to your container

POST [:attach_url]/files

It may happen that you require a file to be present in your temporary container, for a batch or anything else, the transfer is done via a multipart form.

The Content-Type of this request is not application/json, it should be multipart/form-data; boundary=[:boundary]

It has to be done before attaching to the container. Files can be found in the directory /tmp/uploads

Form parameters:

  • file: contain the name of the file and its content.

Example request:

curl --form file=@mysql_dump.tar.gz [:attach_url]/files

Returns 200 OK Without content