Trigger file workflow

Triggers the workflow associated with the specified file and returns the actual number of triggers.

HTTP
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

Shell
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

volume_id

integer

Yes

ID of the root volume to which the file belongs.

file_ids

array of string

Yes

The unique file IDs from 1 to 1000 must be actually mounted under the specified volume_id.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "triggered": 1
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.triggered

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

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on