Trigger file workflow¶
Triggers the workflow associated with the specified file and returns the actual number triggered.
POST $CLOUDSIGMA_API_BASE/catalog/file/trigger_workflow
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the file list to obtain the target file and the volume to which it belongs.
Set the operation-specific values used in the request:
$VOLUME_ID: ID of the root volume to which the file belongs.$FILE_ID: The file ID to trigger the associated workflow.
Request¶
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"'"]
}'
Request body
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
ID of the root volume to which the file belongs. |
|
string[] |
Yes |
List of file IDs to trigger. |
[] after a type means an array. For example, string[] is an array of strings.
Successful response¶
When successful, 200 is returned. triggered indicates the number of associated workflows actually triggered this time.
{
"code": "OK",
"msg": "OK",
"data": {
"triggered": 1
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
The number of associated workflows actually triggered this time. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid volume ID or file ID list. |
Check the resource identifier in the request body. |
|
|
The current identity does not have read permission to the target volume. |
Use credentials with read permissions. |
|
|
The server failed to trigger the associated workflow. |
Try again later and confirm the execution status via the relevant workflow page. |