跳到主要内容

Download SFTP

Learn how to add and configure the \"Download SFTP password\" action in your Buddy pipeline

Download SFTP (Password)

POST参数

名称类型描述
name
必填
String操作名称
type
必填
StringThe type of the action. Should be set to DOWNLOAD_SSH.
source_path
必填
StringThe path from which the file will be downloaded.
destination_path
必填
StringThe path in which the file will be saved.
authentication_mode
必填
StringThe authentication mode for SSH. Should be set to PASS.
host
必填
StringThe host for the connection.
login
必填
StringThe username required to connect to the server.
password
必填
StringThe password required to connect to the server.
port
必填
StringThe port for the connection.
passphraseStringThe passphrase for the private SSH key.
overwriteBooleanReplace files if they already exist.
recursiveBooleanIf set to true, the whole directory tree is downloaded, otherwise only the files from the path are downloaded.
download_excludesString[]The paths and/or files that will be left out during the download.
download_includesString[]The exceptions from the ignore patterns set in download_excludes.

示例

请求

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

JSON

{
"name":"Download files from $host by SFTP",
"login":"pass",
"password":"testtest",
"host":"$host",
"port":"22",
"type":"DOWNLOAD_SSH",
"authentication_mode":"PASS",
"trigger_time":"ON_EVERY_EXECUTION",
"source_path":"source",
"destination_path":"destination",
"recursive":false,
"overwrite":false,
"download_excludes": [
"/tmp",
"*.log"
],
"download_includes": [
"/tmp/assets",
"/tmp/styles"
]
}

示例响应

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/pipeline/2/action/2/edit",
  "id":2,
  "name":"Download files from $host by SFTP",
  "type":"DOWNLOAD_SSH",
  "trigger_time":"ON_EVERY_EXECUTION",
  "last_execution_status":"INITIAL",
  "source_path":"source",
"destination_path":"destination",
  "login":"pass",
  "password":"secure!Ei38xlam4zIE0Kf4DhbFkA==",
  "host":"$host",
  "port":"22",
  "authentication_mode":"PASS",
  "recursive":false,
  "overwrite":false,
"download_excludes": [
"/tmp",
"*.log"
],
"download_includes": [
"/tmp/assets",
"/tmp/styles"
],
"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":"test server",
   "refs": [
"refs/heads/master"
],
   "last_execution_status":"SUCCESSFUL",
   "last_execution_revision":"506a3963507943d6908154f4bc9646e829128a08"
  }
}

Download SFTP (Private key)

POST参数

Buddy所有操作通用参数列表

:::

名称类型描述
name
必填
String操作名称
type
必填
StringThe type of the action. Should be set to DOWNLOAD_SSH.
source_path
必填
StringThe path from which the file will be downloaded.
destination_path
必填
StringThe path in which the file will be saved.
authentication_mode
必填
StringThe authentication mode for SSH. Should be set to PRIVATE_KEY.
host
必填
StringThe host for the connection.
login
必填
StringThe username required to connect to the server.
server_key
必填
StringThe private SSH key. Required if authentication_mode is set to PRIVATE_KEY.
port
必填
StringThe port for the connection.
passphraseStringThe passphrase for the private SSH key.
overwriteBooleanReplace files if they already exist.
recursiveBooleanIf set to true, the whole directory tree is downloaded, otherwise only the files from the path are downloaded.
download_excludesString[]The paths and/or files that will be left out during the download.
download_includesString[]The exceptions from the ignore patterns set in download_excludes.

示例

请求

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

JSON

{ 
  "name":"Download files from $host by SFTP(Key & Phrase)",
  "login":"keyphrase",
  "host":"$host",
  "port":"22",
  "type":"DOWNLOAD_SSH",
  "authentication_mode":"PRIVATE_KEY",
  "trigger_time":"ON_EVERY_EXECUTION",
  "source_path":"source",
"destination_path":"destination",
  "server_key":"-----BEGIN RSA PRIVATE KEY-----\r\nProc-Type: 4,ENCRYPTED\r\nDEK-Info: DES-EDE3-CBC,688DBB59CFC83D58\r\n\r\n1m3qZGEqXEfLPIm9KZacr17/iMVOIJcvSLoMJueM8+QbcK4JStzbre2AN99TkCN/\r\nr1V12deiq/lJUPX07K30tnsTS+7z4Pq/D2WhirD+WQcREgdQU1A8dlx2NMRDi7d0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430qRZh9LQQKbjvxHonU8Z\r\nXFeRpwG32YLSCSQunJtoEWQRJpVefc7rEmBAdLfNyA7xyqH2JLtlflaH9QApl7vE\r\nGNJJ5iuHCHPJwfhlaSMBF/Cb9Ofp4BM5fnNKrwaI9twv//U6XhVfYRcaKhCFEoMb\r\nYo4k7cKTQzL95xT1aYnwqSqtaDfoXASoA9j/mD0aMU+9zQEa0tVbJ/6Zjn3vMSTx\r\npvCYkXy9kZzEJZ2r7BiaQX0HX5Ki/Opt4eTWL5NbokDsE1bQu+D2BskJz30pRRRK\r\nvRargCRNl26158HNRLPkbo/gkwfJbfIBFgJ8YEQkcNap110oEaW6l3lnktZ0Ct3P\r\nEjkrppoV6UU1HCVmcoljOldTXQZuKmpz7aIuSwmUqoU4vWNvYteIZ3BhaVwCu/p8\r\nVaFL8Sapda0WYXPWXHuV+Dj295bedJxeqraWrQB87vKP4NVyzWv1WA==\r\n-----END RSA PRIVATE KEY-----\r\n",
"passphrase":"password",
  "recursive":false,
  "overwrite":false,
"download_excludes": [
"/tmp",
"*.log"
],
"download_includes": [
"/tmp/assets",
"/tmp/styles"
]
}

示例响应

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/pipeline/2/action/2/edit",
  "id":2,
"name":"Download files from $host by SFTP(Key & Phrase)",
"type":"DOWNLOAD_SSH",
"trigger_time":"ON_EVERY_EXECUTION",
"last_execution_status":"INITIAL",
"source_path":"source",
"login":"keyphrase",
"host":"$host",
"port":"22", "server_key":"secure!DJmUNkJKHUaijmYZogZ5sFy6BpsP77csTkt0iRQqtv36jKbwZJvUISWWauhGUfpS/kENJ3X2QjY2zTebgvlzEfOKB+KmbiWoCYyeGTuLRC22gsuIG2h66lbRQXOLbIQWyXTrZ/9LRWtytKep3u/5gHHPsCG6kShvMcBZM6iJBc72mgL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P/tGPebmfH2eCxmjdo5caybfdpFbguGA1WVDrKfN79o50lHH+EYbBMf1VAH52cx+MG7zjv9kRRggGLjwQT/c8DvtJfOb/2xNp8id+TIg9N/QRj1hDAqCoJjgHcrMAuGl97GtD0Br4HYA=",
"passphrase":"secure!fRLiJc9JfUeCtLILBxWcpQ==",
"authentication_mode":"PRIVATE_KEY",
"recursive":false,
"overwrite":false,
"destination_path":"destination",
"download_excludes": [
"/tmp",
"*.log"
],
"download_includes": [
"/tmp/assets",
"/tmp/styles"
],
"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":"test server",
   "refs": [
"refs/heads/master"
],
   "last_execution_status":"SUCCESSFUL",
   "last_execution_revision":"506a3963507943d6908154f4bc9646e829128a08"
  }
}

Download SFTP (Private key & password)

POST参数

Buddy所有操作通用参数列表

:::

名称类型描述
name
必填
String操作名称
type
必填
StringThe type of the action. Should be set to DOWNLOAD_SSH.
source_path
必填
StringThe path from which the file will be downloaded.
destination_path
必填
StringThe path in which the file will be saved.
authentication_mode
必填
StringThe authentication mode for SSH. Should be set to PRIVATE_KEY_AND_PASS.
host
必填
StringThe host for the connection.
login
必填
StringThe username required to connect to the server.
server_key
必填
StringThe private SSH key. Required if authentication_mode is set to PRIVATE_KEY_AND_PASS.
password
必填
StringThe password required to connect to the server.
port
必填
StringThe port for the connection.
passphraseStringThe passphrase for the private SSH key.
overwriteBooleanReplace files if they already exist.
recursiveBooleanIf set to true, the whole directory tree is downloaded, otherwise only the files from the path are downloaded.
download_excludesString[]The paths and/or files that will be left out during the download.
download_includesString[]The exceptions from the ignore patterns set in download_excludes.

示例

请求

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

JSON

{ 
  "name":"Download files from $host by SFTP(Pass, Key & Phrase)",
  "login":"passkeyphrase",
  "password":"testtest",
  "host":"$host",
  "port":"22",
  "type":"DOWNLOAD_SSH",
  "authentication_mode":"PRIVATE_KEY_AND_PASS",
  "trigger_time":"ON_EVERY_EXECUTION",
  "source_path":"source",
"destination_path":"destination",
  "server_key":"-----BEGIN RSA PRIVATE KEY-----\r\nProc-Type: 4,ENCRYPTED\r\nDEK-Info: DES-EDE3-CBC,688DBB59CFC83D58\r\n\r\n1m3qZGEqXEfLPIm9KZacr17/iMVOIJcvSLoMJueM8+QbcK4JStzbre2AN99TkCN/\r\nr1V12deiq/lJUPX07K30tnsTS+7z4Pq/D2WhirD+WQcREgdQU1A8dlx2NMRDi7d0\r\n32w8ZPlciz3bc5rpF0vy5Ll2q9TWye4fpgQwPUnEkam0SaRRwAMpnT/46/AeWgmn\r\n9nu8CNZp7QcOIR2WH6RNRhQTOD/hC+kVCxbEQUL5MOHV7iZX6BeUwd8bBNmci+o0\r\nz/I7ZLQo596Ih+0KPgA+vwS9c4c1TrUYhupU7tyIL6PwpAzhlq/UwxeE032AypiI\r\nkpm7z8I7MBYZs0bsS5UOa3FdHF8p38KrxozwQfsOmBxEHpAWM3slvqJpauuJLlyx\r\ncFfzgOTFSsLJ5J59ZdVRpeFr/W5+/9wpc+AJUP80i4pMEWsnamwdK9rU6QwpFiPf\r\nARzk6VdIiDlZRWeyoYcEfOGEJt+J0aSlXkt6BHgvkmDGq0YA9CNqb6GdB9t073yX\r\nCAqsQ/XEvDuZw14KHxErr5aL6uuZiioDhUmoGz9S3HstFR4T0nRmfCSrLyxTFQf1\r\nF0Sn9Dv4LrSGrzM/0svdlqUc5TDxPBVoW2Q56dNkAQwJg0k25x5YLdTUcd4GjbJW\r\n0qLJaO+bxfTDk5rCMHflYNCW18fEdeEvpBwL0ey93+Qya4xqjTOy2fgoz9U0QLUD\r\nfbgWSiFWnurC8I/SYcQUAEOKiYCDRzud92WzyjwRr2yPlcqf/Qi8+VNDyvoGYZgi\r\nD3vgqA9KPKnYkODYKIFTMW0bbRkgnLOsc1v5mkPTerUpeOGWPysOu3WV9if9e2lG\r\npG1gVfRJQei0k5Mex6CCV0gSQbf2MjswiyDvrPQ1yhpCsFeDAGKcLx+GU1/AhLRP\r\np32mqF5XJrMSTvifCGNOHkBMVUXmTjF7KCYZvcsERi1i2xNcwtcsLRm+QJKQsYQf\r\nhJ17/lOOcC8cqVLGmik3adOcOMCWq2b+NjgoJT55Hc0N07ikuQqazhFpZKkMFZEr\r\nFqbDZ2zGMwODjcDancXaghSS7ciIEdoAPGor1rftJ+l2oQVzBPk4pNfBKHJC7UmS\r\nUOGW3rGLSlRQcVEBFHbrsGP/JKXd06Cbrc3kDrdXbO430qRZh9LQQKbjvxHonU8Z\r\nXFeRpwG32YLSCSQunJtoEWQRJpVefc7rEmBAdLfNyA7xyqH2JLtlflaH9QApl7vE\r\nGNJJ5iuHCHPJwfhlaSMBF/Cb9Ofp4BM5fnNKrwaI9twv//U6XhVfYRcaKhCFEoMb\r\nYo4k7cKTQzL95xT1aYnwqSqtaDfoXASoA9j/mD0aMU+9zQEa0tVbJ/6Zjn3vMSTx\r\npvCYkXy9kZzEJZ2r7BiaQX0HX5Ki/Opt4eTWL5NbokDsE1bQu+D2BskJz30pRRRK\r\nvRargCRNl26158HNRLPkbo/gkwfJbfIBFgJ8YEQkcNap110oEaW6l3lnktZ0Ct3P\r\nEjkrppoV6UU1HCVmcoljOldTXQZuKmpz7aIuSwmUqoU4vWNvYteIZ3BhaVwCu/p8\r\nVaFL8Sapda0WYXPWXHuV+Dj295bedJxeqraWrQB87vKP4NVyzWv1WA==\r\n-----END RSA PRIVATE KEY-----\r\n",
  "passphrase":"password",
  "recursive":false,
  "overwrite":false,
"download_excludes": [
"/tmp",
"*.log"
],
"download_includes": [
"/tmp/assets",
"/tmp/styles"
]
},

示例响应

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/pipeline/2/action/2/edit",
  "id":2,
"name":"Download files from $host by SFTP(Pass, Key & Phrase)",
"type":"DOWNLOAD_SSH",
"trigger_time":"ON_EVERY_EXECUTION",
"last_execution_status":"INITIAL",
"source_path":"source",
"login":"passkeyphrase",
"password":"secure!4A9W52gDG/wplkM8gkA/1w==",
"host":"$host",
"port":"22",
"server_key":"secure!DJmUNkJKHUaijmYZogZ5sFy6BpsP77csTkt0iRQqtv36jKbwZJvUISWWauhGUfpS/kENJ3X2QjY2zTebgvlzEfOKB+KmbiWoCYyeGTuLRC22gsuIG2h66lbRQXOLbIQWyXTrZ/9LRWtytKep3u/5gHHPsCG6kShvMcBZM6iJBc72mgLwLzixyHG1BFxBmXr+hF9yS/sue2h8NnOhY+kQvxLFsWP0Eq6i+PuOAO29ujnr+FXKGKmeT5qDkB+/EfG4vbfLFr2j05J9+risGBafdfWFuSRzeNQlsg8HzJYtO13n5G9hTebRgmKlee/MDX4Gdo8i6pWyddWpwgNbaGNf/afV27ZOMFGfvTy0IS3Hf/Nc9uEn5K+Ej69h9oc7dQskz0lVWewEBa9w5sGTFcZftG0/E5rzxLF90cWcdJiTtCMhsShlXqJDdgzpCjg3Fk+2DniXYM8tJCGBhgFgU0gqHz8x/A/wjWMmU7LuvfLeVGJe/KxQ551QqDytZpyH36PAsN/0VAC8sfskELuZukKMQRU82xqDTJCMlSu8ezyLLb9utakm7sGHBw3HWJe/ayABUN7g1bYYGYx9cTMf7eaRm78ZH5bA7SyXPfMOPhiGteQ2stSu5d9QisaUVaFNJRpv9aRN/7uNm7jfg8n4JRrvscsSqgx4m2hcsIyWQ0vGv4O4mRWANhpZskix6QgfUNoW6iOEKhEQB+NCAewMQi4WLuFylstJU3L1mAxhPA6PFQetJb2L9eUD8oibTfDUSKDwdBhdLZ8P2POPo5b0Ls92f0ktAK0eOHSr8i0LrW0JWziX6rxz2Eg8td4rjSswgcyLS9aRtHeINKPVYg5l3sODAfu3CzqAnCjMBg/FzxtaffZ1RZUyRzyw+g1XcE8lFfR6W+SVgt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yuLliGxLSFgFMhUzu5zAq3a9c/JKPSB5jKIX+TUrLQsTCFF6xLTqGnnGR6r227YA9FOLg+D+KDjfRe7LR8tkyfMe8QCPqgC/Mr47jOn5Na27SxYy83JclRAXbCkztTsUSO9OKkCvU0OPO457ADd93f30QQCZQBnBOiqbzo7/bJILGfiRVRLWw+tC+FBkmd6755IOed2u2GmxS8RkeluSM1UNDqzYyMJNIwUumd+7nlmXvKEHQRyl0u8UNf/m9xcw11OLkjJ0YrIfXZ536+J0ijaLmv+l3VrgSblHKjQi1AOOFXRyUIFli/NW8tBdhr8+06sUKrqiELSHXWOL1qmMGH5LwzgAa4OsFQy22P/tGPebmfH2eCxmjdo5caybfdpFbguGA1WVDrKfN79o50lHH+EYbBMf1VAH52cx+MG7zjv9kRRggGLjwQT/c8DvtJfOb/2xNp8id+TIg9N/QRj1hDAqCoJjgHcrMAuGl97GtD0Br4HYA=",
"passphrase":"secure!uWTHIU71byT5ESHGJM4JeQ==",
"authentication_mode":"PRIVATE_KEY_AND_PASS",
"recursive":false,
"overwrite":false,
"destination_path":"destination",
"download_excludes": [
"/tmp",
"*.log"
],
"download_includes": [
"/tmp/assets",
"/tmp/styles"
],
"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":"test server",
   "refs": [
"refs/heads/master"
],
   "last_execution_status":"SUCCESSFUL",
   "last_execution_revision":"506a3963507943d6908154f4bc9646e829128a08"
  }
}

Download SFTP (Private key from environment variables)

POST参数

Buddy所有操作通用参数列表

:::

名称类型描述
name
必填
String操作名称
type
必填
StringThe type of the action. Should be set to DOWNLOAD_SSH.
source_path
必填
StringThe path from which the file will be downloaded.
destination_path
必填
StringThe path in which the file will be saved.
authentication_mode
必填
StringThe authentication mode for SSH. Should be set to ENV_KEY.
host
必填
StringThe host for the connection.
login
必填
StringThe username required to connect to the server.
env_key
必填
StringThe private SSH key name defined in environment variables.
port
必填
StringThe port for the connection.
overwriteBooleanReplace files if they already exist.
recursiveBooleanIf set to true, the whole directory tree is downloaded, otherwise only the files from the path are downloaded.
download_excludesString[]The paths and/or files that will be left out during the download.
download_includesString[]The exceptions from the ignore patterns set in download_excludes.

示例

请求

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

JSON

{
"name": "Download files from $host",
"type": "DOWNLOAD_SSH",
"source_path": "source",
"destination_path": "destination",
"login": "username",
"host": "$host",
"port":"22",
"env_key": "envkey",
"authentication_mode": "ENV_KEY",
"recursive": true,
"overwrite": true,
"trigger_time": "ON_EVERY_EXECUTION",
"download_excludes": [
"/tmp",
"*.log"
],
"download_includes": [
"/tmp/assets",
"/tmp/styles"
]
}

示例响应

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/pipeline/2/action/2/edit",
  "id":2,
"name":"Download files from $host",
"type":"DOWNLOAD_SSH",
"trigger_time":"ON_EVERY_EXECUTION",
"last_execution_status":"INITIAL",
"source_path":"source",
"login":"username",
"host":"$host",
"env_key":"secure!PuYmIP3yRej9rErRBfp2eg==",
"authentication_mode":"ENV_KEY",
"recursive":true,
"overwrite":true,
"destination_path":"destination",
"download_excludes": [
"/tmp",
"*.log"
],
"download_includes": [
"/tmp/assets",
"/tmp/styles"
],
"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":"test server",
   "on": "CLICK",
"refs": [
"refs/heads/master"
],
   "last_execution_status":"SUCCESSFUL",
   "last_execution_revision":"506a3963507943d6908154f4bc9646e829128a08"
}
}

Proxy

To define a proxy server, use the following parameters:

名称类型描述
proxy_loginStringThe username required to connect to the proxy server.
proxy_hostStringThe host for the proxy connection.
proxy_portStringThe port for the proxy connection.
proxy_authentication_modeStringThe authentication mode for SSH proxy connection. Can be set to PASS, PRIVATE_KEY, PRIVATE_KEY_AND_PASS or ENV_KEY.
proxy_passwordStringThe password required to connect to the proxy server.
proxy_passphraseStringThe passphrase for the private SSH key.
proxy_env_keyStringThe private SSH key name defined in environment variables.
proxy_server_keyStringThe private SSH key.

Example for Proxy Password

  "proxy_authentication_mode": "PASS"  
"proxy_login": "proxyUser",
"proxy_host": "proxyHost",
"proxy_port": "proxyPort",
"proxy_password": "proxyPassword"

Example for Proxy Private Key

  "proxy_authentication_mode": "PRIVATE_KEY"  
"proxy_login": "proxyUser",
"proxy_host": "proxyHost",
"proxy_port": "proxyPort",
"proxy_passphrase": "proxyPassphrase",
"proxy_server_key": "proxyServerkey"

Example for Proxy Private Key and Password

  "proxy_authentication_mode": "PRIVATE_KEY_AND_PASS"  
"proxy_login": "proxyUser",
"proxy_host": "proxyHost",
"proxy_port": "proxyPort",
"proxy_password": "proxyPassword",
"proxy_passphrase": "proxyPassphrase",
"proxy_server_key": "proxyServerkey"

Example for Proxy Env Key

  "proxy_authentication_mode": "ENV_KEY"  
"proxy_login": "proxyUser",
"proxy_host": "proxyHost",
"proxy_port": "proxyPort",
"proxy_env_key": "proxyMyEnvkey"