Trigger file workflow¶
Triggers the workflow associated with the specified file and returns the actual number of triggers.
POST $CLOUDSIGMA_API_BASE/catalog/file/trigger_workflow
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the file list to obtain the target file and the volume to which it belongs. Prepare a list of personal access tokens, target workspace IDs, volume IDs, and file IDs that can access the target workspace.
Confirm that the current identity has volume.read permissions on the target volume and workflow.run permissions on the bound workflow.
Select a non-reserved volume.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/file/trigger_workflow" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"volume_id": '"$VOLUME_ID"',
"file_ids": ["'"$FILE_ID"'"]
}'
Execution uses the creator, role, version, and compute configuration saved in the binding.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
ID of the root volume to which the file belongs. |
|
array of string |
Yes |
The unique file IDs from 1 to 1000 must be actually mounted under the specified volume_id. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"triggered": 1
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer |
The number of persistent dispatch records created, that is, the number of trigger and file pairs. It is not the number of different workflows, nor does it indicate completion of execution. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |