Update custom operator

Modify the configuration or code of a custom operator. The enabled status cannot be modified through this interface, please use dedicated enable or disable operations.

HTTP
PUT $CLOUDSIGMA_API_BASE/workflow/v2/custom-operators/$OPERATOR_ID

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

First query custom operator details to confirm the operator to be modified.

Do not pass enabled in the request body; instead use Enable custom operator or Disable custom operator.

Request

All fields are optional; submit only the fields you want to modify.

Shell
curl -X PUT "$CLOUDSIGMA_API_BASE/workflow/v2/custom-operators/$OPERATOR_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Counts characters in the input text and returns results.",
    "code": "def handle(workspace_id, sdk, input):\n    return {\"count\": len(input[\"text\"])}"
  }'

Request body

FieldTypeDescription
descriptionstringOperator description.
codestringSource code.
namestringOperator name.
kindstringOperator type.
languagestringOperator implementation language.
handlerstringOperator handler.
versionstringOperator version.
isolation_levelstringOperator isolation configuration.
input_schemaobjectInput definition.
output_schemaobjectOutput definition.
source_file_idstringSource file ID.
base_node_idstringBase operator ID.
base_node_versionstringBase operator version.
binding_configobjectBinding configuration.
catalog_idintegerAssociated catalog ID.
database_idintegerAssociated database ID.

Successful response

The response returns the updated operator configuration.

The response fields are as follows.

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 123,
    "node_id": "moi:custom.operator:workspace:text_counter",
    "name": "Text Counter",
    "identifier": "text_counter",
    "description": "Counts characters in the input text and returns results.",
    "language": 1,
    "kind": 1,
    "handler": "main.handle",
    "version": "1.0.0",
    "input_schema": "{\"type\":\"object\"}",
    "output_schema": "{\"type\":\"object\"}",
    "isolation_level": "PUBLIC",
    "catalog_id": 1,
    "database_id": 2,
    "enabled": true
  }
}
FieldTypeDescription
codestringOK on success.
msgstringOK on success.
data.idintegerCustom operator ID.
data.node_idstringOperator ID in the workflow.
data.namestringOperator name.
data.identifierstringOperator ID.
data.descriptionstringUpdated operator description; returned if there is a value.
data.handlerstringUpdated processing function; returned when there is a value.
data.versionstringThe updated operator version; returned if there is a value.
data.isolation_levelstringThe updated isolation configuration; returned if there is a value.
data.languageintegerImplements the numerical encoding of the language; returns if there is a value.
data.kindintegerNumeric encoding of the operator type; returned if there is a value.
data.source_file_idstringSource file ID; returned when created using a source file.
data.input_schemastringEnter the defined serialization content; return if there is a value.
data.output_schemastringOutput the defined serialized content; return if there is a value.
data.binding_configstringThe serialized content of the binding configuration; returned if there is a value.
data.created_bystringCreator ID; returned if there is a value.
data.updated_bystringLast updater ID; returned if there is a value.
data.created_atintegerCreation timestamp; returned if there is a value.
data.updated_atintegerLast updated timestamp; returned if there is a value.
data.base_node_idstringThe basic operator associated with the built-in binding type; returned when there is a value.
data.base_node_versionstringThe basic operator version associated with the built-in binding type; returned when there is a value.
data.catalog_idintegerThe associated Catalog ID; returned if there is a value.
data.database_idintegerThe associated database ID; returned if there is a value.
data.enabledbooleanWhether the operator is enabled.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}
FieldTypeDescription
codestringError code.
msgstringReadable error message.
datanull`null` in an error response.

Follow-up operations

Use the same resource identifier query custom operator details to confirm the update result.

Last updated on