Download from sandbox

POST Parameters

NameTypeDescription
name
Required
StringThe name of the action.
type
Required
StringThe type of the action. Should be set to DOWNLOAD_FROM_SANDBOX.
source_pathStringThe path from which the file will be downloaded.
destination_pathStringThe path in which the file will be saved.
deployment_excludesString[]The paths and/or files that will be excluded from the upload.
deployment_includesString[]The exceptions from the ignore patterns set in deployment_excludes.
sandbox_references
Required
StringDefines the sandbox selection method. Available values: BY_TAGSBY_NAMEBY_PROJECTBY_DAYSBY_IDBY_ACTION.
sandbox_idStringThe ID of the sandbox to which the files are uploaded. Required when sandbox_references is set to BY_ID.
referenced_action_idIntThe ID of the action that creates the target sandbox. Required when sandbox_references is set to BY_ACTION.
referenced_sanbox_nameStringThe name of the target sandbox. Required when sandbox_references is set to BY_NAME.
tagsString[]The list of tags applied to the target sandbox. Required when sandbox_references is set to BY_TAGS.
sandbox_project_idIntThe ID of the project with the target sandbox. Required when sandbox_references is set to BY_PROJECT.
daysIntThe number of days passed since the creation of the target sandbox. One of 12371430. Required when sandbox_references is set to BY_DAYS.
recursiveBooleanIf set to true, the whole directory tree is downloaded. Otherwise only the files from the path are downloaded.
overwriteBooleanReplace files if they already exist.

Example

Request

POST https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/actions

JSON

{
  "name": "Download files from a sandbox",
  "type": "DOWNLOAD_FROM_SANDBOX",
  "trigger_time": "ON_EVERY_EXECUTION",
  "source_path": "/assets/",
  "destination_path": "/",
  "deployment_excludes": [
    "/tmp/"
  ],
  "deployment_includes": [
    "/tmp/file.txt"
  ],
  "recursive": true,
  "overwrite": true,
  "user": "root",
  "sandbox_id": "Cgn3QO34klUri",
  "sandbox_references": [
    "BY_ID"
  ]
}

Sample Response

HTTP

Status: 201 Created
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999

JSON

{
  "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/actions/2",
  "html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/2/edit",
  "id": 2,
  "name": "Download files from a sandbox",
  "type": "DOWNLOAD_FROM_SANDBOX",
  "trigger_time": "ON_EVERY_EXECUTION",
  "source_path": "/assets/",
  "destination_path": "/",
  "deployment_excludes": [
    "/tmp/"
  ],
  "deployment_includes": [
    "/tmp/file.txt"
  ],
  "recursive": true,
  "overwrite": true,
  "user": "root",
  "sandbox_id": "Cgn3QO34klUri",
  "sandbox_references": [
    "BY_ID"
  ],
  "pipeline": {
    "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2",
    "html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/2",
    "id": 2,
    "name": "Live mirror",
    "refs": [
      "refs/heads/master"
    ],
    "last_execution_status": "SUCCESSFUL",
    "last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08"
  }
}

Last modified on March 28, 2023

Get Started

Sign up for free and deploy your project in less than 10 minutes.