POST
/
api
/
workflows
/
{workflowName}
/
clone
克隆 workflow
curl --request POST \
  --url https://wfapi.yuhe.space/api/workflows/{workflowName}/clone \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "targetWorkflowName": "smoke-copy",
  "displayName": "Smoke Copy",
  "sourceTarget": "latest"
}
'
{
  "errCode": 123,
  "errMessage": "<string>",
  "data": {
    "workflowId": "<string>",
    "workflowName": "<string>",
    "sourceTarget": "<string>",
    "resolvedSourceTarget": "<string>",
    "build": {
      "startedAt": "2023-11-07T05:31:56Z",
      "endedAt": "2023-11-07T05:31:56Z",
      "durationMs": 123,
      "stdout": "<string>",
      "stderr": "<string>",
      "error": "<string>"
    },
    "nextVersion": "<string>"
  }
}

Authorizations

Authorization
string
header
required

使用 WORKFLOW_SERVER_ADMIN_KEY 或已创建的账号 API Key。

Path Parameters

workflowName
string
required

Body

application/json
targetWorkflowName
string
required
Example:

"smoke-copy"

displayName
string
Example:

"Smoke Copy"

sourceTarget
string
Example:

"latest"

Response

200 - application/json

克隆结果。

errCode
integer
required
errMessage
string
required
Allowed value: ""
data
object
required