Create new sandbox

  • POST
  • /workspaces
  • /:domain
  • /projects
  • /:project_name
  • /pipelines
  • /:pipeline_id
  • /actions

Request

URL PARAMETERS
domainrequired string
The workspace domain.
pipeline_idrequired integer
The numerical ID of the desired pipeline.
project_namerequired string
The name ID of the project.
POST PARAMETERS
actionrequired string
The ID of the action.
typerequired string
The type of the action. Must be set to SANDBOX_CREATE_NEW.
sandbox_namerequired string
Defines the name of the created sandbox.
sandbox_distributionrequired string
Defines the OS distro of the sandbox. Can be one of ubuntu/focal or debian/buster.
sandbox_playbooksSandboxPlaybook[]
Defines the list of playbooks to install during the sandbox creation.
tagsstring[]
The list of tags applied to the sandbox.
ram_limitrequired int
Defines the amount of RAM available to the sandbox. Can be one of 2 or 4.
cpu_limitrequired int
Defines the number of vCPUs of the sandbox. Can be one of 1 or 2.
disk_size_limitrequired int
Defines the sandbox disk size. Expressed in GB. Can be one of 5 or 10.
mappingsrequired Mapping[]
Defines the port-subdomain mappings that allow to access exposed resources on the sandbox.
application_portint
Defines the port used in the mapping.
subdomainstring
Defines the subdomain used in the mapping.
basic_authboolean
If set to true, it allows you to use basic authorization in mappings.
mappings_usernamestring
Defines the basic auth username required to access the exposed resources.
mappings_passwordstring
Defines the basic auth password required to access the exposed resources.

Last modified on Sep 27, 2024

Example:

curl -X POST "https://api.buddy.works/workspaces/:domain/projects/:project_name/pipelines/:pipeline_id/actions" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
  "name": "Create new sandbox",
  "type": "SANDBOX_CREATE_NEW",
  "trigger_time": "ON_EVERY_EXECUTION",
  "last_execution_status": "SUCCESSFUL",
  "disabled": false,
  "sandbox_name": "new sandbox with playbooks",
  "ignore_errors": false,
  "run_next_parallel": false,
  "sandbox_distribution": "ubuntu/focal",
  "sandbox_playbooks": [
    {
      "type": "APACHE",
      "install_php": true,
      "php_version": "8.0",
      "php_modules": [
        "gd",
        "mysql",
        "opcache",
        "curl",
        "xml",
        "mbstring",
        "imagick",
        "zip"
      ],
      "modules": [
        "expires",
        "headers",
        "rewrite"
      ]
    },
    {
      "type": "DOCKER"
    },
    {
      "type": "MONGO",
      "version": "5.0"
    },
    {
      "type": "NODE",
      "version": "12"
    },
    {
      "type": "POSTGRES",
      "db": "test",
      "user": "test",
      "password": "test"
    },
    {
      "type": "REDIS"
    },
    {
      "type": "RUBY",
      "version": "2.7"
    },
    {
      "type": "MYSQL",
      "version": "8.0",
      "db": "wp",
      "user": "wp",
      "password": "wp"
    },
    {
      "type": "WORDPRESS",
      "db": "wp",
      "user": "wp",
      "password": "wp",
      "phrase": "wp"
    }
  ],
  "ram_limit": 2,
  "cpu_limit": 1,
  "disk_size_limit": 5,
  "mappings": [
    {
      "application_port": 80,
      "subdomain": "subdomain",
      "basic_auth": true
    }
  ],
  "mappings_username": "root",
  "mappings_password": "password"
}'
STATUS
201 Created
LIMITS
X-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999