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

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 custom operator list, select an operator and obtain the custom operator ID. Then Query custom operator details to confirm the configuration to be modified. Prepare personal access token and target workspace ID that can access the target workspace.

The operator type, version, or enabled status cannot be modified through this interface. To change the type or version, create a new custom operator. To change the enabled status, use Enable custom operator or Disable custom operator.

Request body

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": "统计输入文本的字符数,并返回结果。",
    "code": "def handle(workspace_id, sdk, input):\n    return {\"count\": len(input[\"text\"])}"
  }'

Code text and source file ID cannot be submitted at the same time. Type-specific fields are only used for the corresponding type. When you replace a source file, references to the new file are increased and references to the old file are decreased. When uploading code fails, the service attempts to undo the operation, but external file operations may not be fully undone.

Keep the original value when omitting a field or filling in null. Description: Clear when filling in a blank string. The name cannot be an empty string. The ID of the associated directory and database is cleared when 0 is filled in. Negative numbers cannot be filled in. Even if no fields are modified, the modification time and modifier will be updated.

All fields are optional. Submit only the fields you want to modify.

Field

Type

Required

Description

name

string or null

No

operator name.

description

string or null

No

operator description.

kind

string or null

No

Resource type.

language

string or null

No

operator implementation language.

handler

string or null

No

operator processing function.

version

string or null

No

The current resource version.

isolation_level

string or null

No

operator isolation configuration.

code

string or null

No

source code.

source_file_id

string or null

No

Source file ID.

base_node_id

string or null

No

Base operator ID.

base_node_version

string or null

No

Base operator version.

input_schema

object or string or null

No

Enter the definition.

output_schema

object or string or null

No

Output definition.

binding_config

object or string or null

No

Binding configuration.

catalog_id

integer or null

No

Associate Catalog ID. Non-positive values ​​are ignored when created. 0 clears the association when updating, and negative numbers are invalid.

database_id

integer or null

No

Associated database ID. Non-positive values ​​are ignored when created. 0 clears the association when updating, and negative numbers are invalid.

enabled

null

No

Whether to enable.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 123,
    "node_id": "moi:custom.operator:workspace:text_counter",
    "name": "文本计数",
    "identifier": "text_counter",
    "description": "统计输入文本的字符数,并返回结果。",
    "language": 1,
    "handler": "main.handle",
    "isolation_level": "PUBLIC",
    "input_schema": "{\"type\":\"object\"}",
    "output_schema": "{\"type\":\"object\"}",
    "enabled": true,
    "kind": 1,
    "catalog_id": 1,
    "database_id": 2
  }
}

Field

Type

Description

code

string

success code.

msg

string

Response information.

data

object

The data returned by this operation.

data.id

integer

Custom operator ID.

data.node_id

string

The operator ID in the workflow.

data.name

string

The updated operator name.

data.identifier

string

operator identification.

data.description

string

Updated instructions.

data.language

integer

operator implements language code.

data.handler

string

Code type handler function.

data.version

string

operator version.

data.isolation_level

string

operator isolation configuration.

data.source_file_id

string

Source file ID.

data.input_schema

string

Enter the defined serialization content.

data.output_schema

string

Outputs the serialized content of the definition.

data.enabled

boolean

Current enabled status.

data.created_by

string

Creator ID.

data.updated_by

string

Last updated by identifier.

data.created_at

integer

Unix timestamp of creation time.

data.updated_at

integer

Unix timestamp of last updated time.

data.kind

integer

operator type code.

data.base_node_id

string

Association ID.

data.base_node_version

string

Base node version.

data.binding_config

string

Extended configuration.

data.catalog_id

integer

The associated Catalog ID.

data.database_id

integer

The associated database ID.

Error response

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

Field

Type

Required

Description

code

string

No

error code.

msg

string

No

Readable error message.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

ErrParamInvalid, ErrWorkspaceRequired

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

403

ErrForbidden

The current identity or active role does not have permission for this operation.

Use an authorized identity or contact an administrator to grant access.

404

ErrNotFound

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

ErrAlreadyExists

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

ErrServer

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

ErrServiceUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on